Click here to Skip to main content
15,896,154 members
Articles / Programming Languages / C#

An Extension to the Enterprise Library Logging Application Block

Rate me:
Please Sign up or sign in to vote.
4.76/5 (18 votes)
28 Oct 200612 min read 73.2K   1.5K   51  
Provide more control over logging by extending the Enterprise Library Logging Application Block.
<?xml version="1.0" encoding="utf-8"?>
<root>
  <!-- 
    Microsoft ResX Schema 
    
    Version 2.0
    
    The primary goals of this format is to allow a simple XML format 
    that is mostly human readable. The generation and parsing of the 
    various data types are done through the TypeConverter classes 
    associated with the data types.
    
    Example:
    
    ... ado.net/XML headers & schema ...
    <resheader name="resmimetype">text/microsoft-resx</resheader>
    <resheader name="version">2.0</resheader>
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
        <value>[base64 mime encoded serialized .NET Framework object]</value>
    </data>
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
        <comment>This is a comment</comment>
    </data>
                
    There are any number of "resheader" rows that contain simple 
    name/value pairs.
    
    Each data row contains a name, and value. The row also contains a 
    type or mimetype. Type corresponds to a .NET class that support 
    text/value conversion through the TypeConverter architecture. 
    Classes that don't support this are serialized and stored with the 
    mimetype set.
    
    The mimetype is used for serialized objects, and tells the 
    ResXResourceReader how to depersist the object. This is currently not 
    extensible. For a given mimetype the value must be set accordingly:
    
    Note - application/x-microsoft.net.object.binary.base64 is the format 
    that the ResXResourceWriter will generate, however the reader can 
    read any of the formats listed below.
    
    mimetype: application/x-microsoft.net.object.binary.base64
    value   : The object must be serialized with 
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
            : and then encoded with base64 encoding.
    
    mimetype: application/x-microsoft.net.object.soap.base64
    value   : The object must be serialized with 
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array 
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="metadata">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
              </xsd:sequence>
              <xsd:attribute name="name" use="required" type="xsd:string" />
              <xsd:attribute name="type" type="xsd:string" />
              <xsd:attribute name="mimetype" type="xsd:string" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="assembly">
            <xsd:complexType>
              <xsd:attribute name="alias" type="xsd:string" />
              <xsd:attribute name="name" type="xsd:string" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="data">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="resheader">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <data name="ApplicationLogName" xml:space="preserve">
    <value>Application</value>
  </data>
  <data name="DistributorEventLoggerDefaultApplicationName" xml:space="preserve">
    <value>Enterprise Library Distributor Service</value>
  </data>
  <data name="InstallerCannotReadServiceName" xml:space="preserve">
    <value>Unable to locate serviceName in distributor configuration file</value>
  </data>
  <data name="ProcessQMsgSeeDetails" xml:space="preserve">
    <value>See 'Exception Information Details' below for more information.</value>
  </data>
  <data name="InitializeComponentStartedMessage" xml:space="preserve">
    <value>InitializeComponent - begin</value>
  </data>
  <data name="InitializeComponentStarted" xml:space="preserve">
    <value>The windows service initialization sequence has started.</value>
  </data>
  <data name="ErrorLoadingDistributorConfiguration" xml:space="preserve">
    <value>Error loading Logging Distributor configuration file.</value>
  </data>
  <data name="InitializeComponentCompletedMessage" xml:space="preserve">
    <value>InitializeComponent - end</value>
  </data>
  <data name="InitializeComponentCompleted" xml:space="preserve">
    <value>The windows service initialization sequence is complete. No errors have occurred.</value>
  </data>
  <data name="ErrorInitializingService" xml:space="preserve">
    <value>Error initializing the service. See EventLog for error details.</value>
  </data>
  <data name="InitializeStartupSequenceStartedMessage" xml:space="preserve">
    <value>InitializeStartupSequence - begin</value>
  </data>
  <data name="InitializeStartupSequenceFinishedMessage" xml:space="preserve">
    <value>InitializeStartupSequence - end</value>
  </data>
  <data name="InitializeStartupSequenceErrorMessage" xml:space="preserve">
    <value>InitializeStartupSequence - error</value>
  </data>
  <data name="ValidationStarted" xml:space="preserve">
    <value>The validation sequence has been started.</value>
  </data>
  <data name="ValidationComplete" xml:space="preserve">
    <value>The validation sequence is complete. No errors have occurred.</value>
  </data>
  <data name="ValidationError" xml:space="preserve">
    <value>An error occurred in one of the validation sequences. See 'Exception Information Details' below for more information. The service will be stopped.</value>
  </data>
  <data name="ListenerStopStartedMessage" xml:space="preserve">
    <value>StopListener - begin</value>
  </data>
  <data name="ListenerStopStarted" xml:space="preserve">
    <value>Attempting to stop the queue listener.</value>
  </data>
  <data name="ListenerStopCompletedMessage" xml:space="preserve">
    <value>StopListener - end</value>
  </data>
  <data name="ListenerStopCompleted" xml:space="preserve">
    <value>The queue listener was successfully stopped. No errors occurred. Note: it took [{0}] tries to stop the queue listener.</value>
    <comment>.
 Parameters: 0 - attempts (string) </comment>
  </data>
  <data name="StopListenerWarningMessage" xml:space="preserve">
    <value>StopListener - warning</value>
  </data>
  <data name="ListenerCannotStop" xml:space="preserve">
    <value>The queue listener could not be successfully stopped. No errors occurred. Note: it took [{0}] tries to stop the queue listener. The queue listener might be busy, please retry.</value>
    <comment>.
 Parameters: 0 - attempts (string) </comment>
  </data>
  <data name="ListenerStopErrorMessage" xml:space="preserve">
    <value>StopListener - error</value>
  </data>
  <data name="ListenerStopError" xml:space="preserve">
    <value>An error occurred while trying to stop the queue listener. See 'Exception Information Detail' below for more information.</value>
  </data>
  <data name="ListenerStartingMessage" xml:space="preserve">
    <value>StartListener - begin</value>
  </data>
  <data name="ListenerStarting" xml:space="preserve">
    <value>Attempting to start the queue listener.</value>
  </data>
  <data name="ListenerStartCompleteMessage" xml:space="preserve">
    <value>StartListener - end</value>
  </data>
  <data name="ListenerStartComplete" xml:space="preserve">
    <value>The queue listener has started successfully. Note: the listener timer is set to [{0}] milliseconds.</value>
    <comment>.
 Parameters: 0 - interval (int) </comment>
  </data>
  <data name="ListenerStartErrorMessage" xml:space="preserve">
    <value>StartListener - error</value>
  </data>
  <data name="ListenerStartError" xml:space="preserve">
    <value>An error occurred while trying to start the queue listener. See 'Exception Information Detail' below for more information.</value>
  </data>
  <data name="ServiceStartComplete" xml:space="preserve">
    <value>The service '{0}' started correctly.</value>
    <comment>.
 Parameters: 0 - service (string) </comment>
  </data>
  <data name="ServiceStartError" xml:space="preserve">
    <value>An error occurred while starting the service {0}.
See 'Summary for {0}' and additional 'Exception Information Details' below for more information. The service needs to be stopped.</value>
    <comment>.
 Parameters: 0 - service (string) </comment>
  </data>
  <data name="ServiceStopComplete" xml:space="preserve">
    <value>The service '{0}' stopped correctly.</value>
    <comment>.
 Parameters: 0 - service (string) </comment>
  </data>
  <data name="ServiceStopWarning" xml:space="preserve">
    <value>The service '{0}' did not stop gracefully. 
See 'Summary for {0}' and additional 'Exception Information Details' below for more information.</value>
    <comment>.
 Parameters: 0 - service (string) </comment>
  </data>
  <data name="ServiceStopError" xml:space="preserve">
    <value>The service '{0}' did not stop correctly.
See 'Summary for {0}' and additional 'Exception Information Details' below for more information. The service will be stopped.</value>
    <comment>.
 Parameters: 0 - service (string) </comment>
  </data>
  <data name="ServicePausedSuccess" xml:space="preserve">
    <value>The service '{0}' was paused correctly.</value>
    <comment>.
 Parameters: 0 - service (string) </comment>
  </data>
  <data name="ServicePauseWarning" xml:space="preserve">
    <value>The service '{0}' did not pause gracefully. 
See 'Summary for {0}' and additional 'Exception Information Details' below for more information.</value>
    <comment>.
 Parameters: 0 - service (string) </comment>
  </data>
  <data name="ServicePauseError" xml:space="preserve">
    <value>The service '{0}' did not pause correctly.
See 'Summary for {0}' and additional 'Exception Information Details' below for more information. The service will be stopped.</value>
    <comment>.
 Parameters: 0 - service (string) </comment>
  </data>
  <data name="ServiceUnableToShutdown" xml:space="preserve">
    <value>An error occurred while trying to shut down the service {0}. This error will disable the ability for this service to shut itself down.</value>
  </data>
  <data name="ServiceResumeComplete" xml:space="preserve">
    <value> The service '{0}' resumed correctly.</value>
    <comment>.
 Parameters: 0 - service (string) </comment>
  </data>
  <data name="ServiceResumeError" xml:space="preserve">
    <value> The service '{0}' was not resumed correctly.
See 'Summary for {0}' and additional 'Exception Information Details' below for more information. The service will be stopped.</value>
    <comment>.
 Parameters: 0 - service (string) </comment>
  </data>
  <data name="QueueTimedEventError" xml:space="preserve">
    <value>An error occurred while receiving message(s) from the queue. The service will be stopped.</value>
  </data>
  <data name="ServiceControllerStopError" xml:space="preserve">
    <value>The Service Controller could not stop the service '{0}'. Make sure the service name listed in the Service Management Console is the same as {0}.
 To solve this problem, stop the service manually and uninstall it. Try the installation procedure again and make sure the same application configuration file is available when the service is started.</value>
    <comment>.
 Parameters: 0 - service (string) </comment>
  </data>
  <data name="ServiceControllerStopException" xml:space="preserve">
    <value>Cannot stop the service '{0}'.</value>
    <comment>.
 Parameters: 0 - p (string) </comment>
  </data>
  <data name="MsmqInvalidTransactionUsage" xml:space="preserve">
    <value>The MSMQDistributor queue '{0}' returned an invalid transaction usage error.  See 'Exception Information Details' below for more information.</value>
    <comment>.
 Parameters: 0 - msmqPath (string) </comment>
  </data>
  <data name="MsmqReceiveTimeout" xml:space="preserve">
    <value>The DistributorMSMQ queue  '{0}'  encountered a receive timeout error.  See 'Exception Information Details' below for more information.</value>
    <comment>.
 Parameters: 0 - msmqPath (string) </comment>
  </data>
  <data name="MsmqAccessDenied" xml:space="preserve">
    <value>Access denied to the DistributorMSMQ queue '{0}'. Identity trying to access the queue : {1}.   See 'Exception Information Details' below for more information.</value>
    <comment>.
 Parameters: 0 - msmqPath (string), 1 - identity (string) </comment>
  </data>
  <data name="MsmqReceiveError" xml:space="preserve">
    <value>An error occurred while receiving a message from the queue '{0}'.  See 'Exception Information Details' below for more information.</value>
    <comment>.
 Parameters: 0 - msmqPath (string) </comment>
  </data>
  <data name="MsmqReceiveGeneralError" xml:space="preserve">
    <value>A general error occurred while receiving a message from the queue '{0}'.</value>
    <comment>.
 Parameters: 0 - msmqPath (string) </comment>
  </data>
  <data name="MsmqLogReceived" xml:space="preserve">
    <value>Log received by MSMQ Log Distributor.  

Message: {0}</value>
    <comment>.
 Parameters: 0 - messageBody (string) </comment>
  </data>
  <data name="UnknownError" xml:space="preserve">
    <value>An unknown error has occurred.</value>
  </data>
  <data name="DistEventLoggerMessagePrefix" xml:space="preserve">
    <value>Message: 
</value>
  </data>
  <data name="Exception" xml:space="preserve">
    <value>exception</value>
  </data>
  <data name="ExceptionCouldNotDeserializeMessageFromQueue" xml:space="preserve">
    <value>Unable to deserialize message with id {0} from queue {1}. Please make sure only LogEntries are traced and a BinaryFormatter is used to format the message. To resolve this error, please remove the message from the queue and start the Service again. The service will be stopped.</value>
  </data>
  <data name="ExceptionCouldNotFindConfigurationSection" xml:space="preserve">
    <value>The {0} section could not be found in the service's configuration file.</value>
  </data>
  <data name="DistributorServiceNameTag" xml:space="preserve">
    <value>name</value>
  </data>
</root>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Australia Australia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions