Navigation:  IM Sequencer >

Logging

Previous pageReturn to chapter overviewNext page

The IM Sequencer application is divided in two separate components, one component is called the client the other is the service. The service manages the scheduled tasks, the client actually runs the step configurations.

 

The logging is also divided in two separate files, the use the same technique called log4net, more information can be found at http://logging.apache.org/log4net/.

 

With Log4Net the logging implementation is separated from the actual program. If you need to send the logging to a database or send an email if an logging error occur you can set it trough the Log4Net configuration file.

 

IM Sequencer Client

 

The logging for the IM Sequencer Client is defined in the file "IM Sequencer Client.exe.config" This file can be found in the IM Sequencer installation directory (default location "<Installation Directory>\Traxion\IM Sequencer")
 
Below is an example Log4Net configuration displayed:

 

   <!-- This section contains the log4net configuration settings -->

       <!-- Set threshold to OFF to disable logging -->

       <log4net threshold="ALL">

  <!-- Eventlog appender. Only logs ERROR and FATAL -->

  <appender name="Eventlog" type="log4net.Appender.EventLogAppender">

    <param name="LogName" value="Application" />

    <param name="ApplicationName" value="IM Sequencer Client" />

    <filter type="log4net.Filter.LevelRangeFilter">

      <param name="LevelMin" value="ERROR" />

    </filter>

    <layout type="log4net.Layout.PatternLayout">

      <conversionPattern value="%message" />

    </layout>

  </appender>

 

  <!-- Appender for sending snmp traps -->

  <appender name="NetworkManagement" type="Traxion.IM.Library.Logging.Appenders.SnmpAppender, Traxion.IM.Library.Logging.Appenders">

    <ManagementServerAddress value="Provide ip or address for the SNMP server" />

    <ManagementServerListenPort value="Provide port that the SNMP server listens on" />

    <LocalAgentAddress value="127.0.0.1" />

    <EnterpriseOid value="1.3.6.1.4.1.24.0" />

    <!--Valid values are ColdStart, WarmStart, LinkDown, LinkUp, AuthenticationFailure, EgpNeighborLoss, EnterpriseSpecific -->

    <GenericTrapType value="EnterpriseSpecific" />

    <SpecificTrapType value="0" />

    <CommunityString value="public" />

    <ApplicationTrapOid value="1.3.6.1.4.1.24.12.10.22.64" />

    <!-- Valid versions are V1 and V2 -->

    <Version value="V1" />

    <threshold value="ERROR" />

    <layout type="log4net.Layout.PatternLayout">

      <!-- Pattern to output the caller's file name and line number -->

      <conversionPattern value="%date [%level] %type.%method{1} - %message" />

    </layout>

  </appender>

  <!--

  Debugger appender used for tracing. Logs ALL (uncomment if tracing is required).

  To catch all messages which are send to the debugger run DebugView for Windows (http://www.microsoft.com/technet/sysinternals/utilities/debugview.mspx)

  -->

  <appender name="Debugger" type="log4net.Appender.OutputDebugStringAppender">

    <layout type="log4net.Layout.PatternLayout">

      <conversionPattern value="[%level] %type.%method{1} - %message" />

    </layout>

  </appender>

 

  <!-- Define console appender, all messages are logged to the console -->

  <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >

    <layout type="log4net.Layout.PatternLayout">

      <conversionPattern value="%date [%level] %type.%method{1} - %message  %newline " />

    </layout>

  </appender>

 

<!--Define rolling file appender, maximum log file size is 100 mb (10 x 10 mb)-->

<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">

       <file value="Log\Sequencer_Client.log" />

       <appendToFile value="true" />

       <rollingStyle value="Size" />

       <maxSizeRollBackups value="10" />

       <maximumFileSize value="10MB" />

       <staticLogFileName value="true" />

       <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />

       <layout type="log4net.Layout.PatternLayout">

               <header value="Start logging&#13;&#10;" />

               <footer value="Stop logging&#13;&#10;" />

           <conversionPattern value="%date [%level] %type.%method{1} - %message  %newline " />

       </layout>

</appender>

       

<!-- Setup the root category, add the appenders and set the default level -->

<root>

       <!-- Possible values are FATAL, ERROR, WARN, INFO, DEBUG or TRACE -->

    <!-- Active log appenders. If tracing is required uncomment 'Debugger' -->

       <level value="INFO" />

     <appender-ref ref="Eventlog" />

     <!--<appender-ref ref="Debugger" />-->

     <!--<appender-ref ref="NetworkManagement" />-->

     <appender-ref ref="ConsoleAppender" />

       <appender-ref ref="RollingFileAppender" />

  </root>

               

<!-- Print only messages of level defined in the package Traxion.IM.Sequencer.Client -->

       <logger name="Traxion.IM.Sequencer.Client">

               <level value="INFO" />

       </logger>

       

       <!-- Print only messages of level defined in the package Traxion.IM.Sequencer -->

       <logger name="Traxion.IM.Sequencer">

               <level value="INFO" />

       </logger>

       

       <!-- Print only messages of level defined in the package Traxion.IM.Library -->

       <logger name="Traxion.IM.Library">

               <level value="INFO" />

       </logger>

       <!-- Print only messages of level defined in the package Traxion.IM.WMI_Lib -->

       <logger name="Traxion.IM.WMI">

               <level value="INFO" />

       </logger>

       

       <!-- Print only messages of level defined in the package Traxion.IM.Scheduler -->

       <logger name="Traxion.IM.Scheduler">

               <level value="INFO" />

       </logger>

</log4net>

 

This configuration contains 2 Appenders. Appenders are actual listeners. All the messages that are logged within the IM Sequencer are send to the Appenders. The Appenders will handle the messages appropriately.
 
The configuration contains a Console Appender:
 
  <!-- Define console appender, all messages are logged to the console -->

  <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >

    <layout type="log4net.Layout.PatternLayout">

      <conversionPattern value="%date [%level] %type.%method{1} - %message  %newline " />

    </layout>

  </appender>

 

This Appender logs to any console when it's attached, you can define your own pattern. This pattern says:

 

For each message print the current date, the error level the class that has send the message and the actual message.
 
Below is an example output:

 

       2006-11-13 10:43:07,940 INFO  Traxion.IM.Sequencer.Client.MainStartup - IM Sequencer version: '3.0.0.0' will be started

 

This configuration also contains a RollingFileAppender, this Appender write all messages to a specified file and makes sure the files are rolled over when the thresholds are reached.

 

               <!--Define rolling file appender, maximum log file size is 100 mb (10 x 10 mb)-->

               <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">

                       <file value="Log\Sequencer_Client.log" />

                       <appendToFile value="true" />

                       <rollingStyle value="Size" />

                       <maxSizeRollBackups value="10" />

                       <maximumFileSize value="10MB" />

                       <staticLogFileName value="true" />

                       <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />

                       <layout type="log4net.Layout.PatternLayout">

                               <header value="Start logging&#13;&#10;" />

                               <footer value="Stop logging&#13;&#10;" />

                             <conversionPattern value="%date [%level] %type.%method{1} - %message  %newline " />

                       </layout>

               </appender>
 
This Appender logs all messages to a file called "Sequencer_Client.log" in the "Log" directory (relative path), there can be only 10 files with a maximum size of 10 MB, the

pattern used is the same as above.
 
You can set your own Appenders or customize the existing ones.

More information about Appenders can be found at http://logging.apache.org/log4net/release/manual/configuration.html#appenders

 

To increase or decrease the logging you can change the log levels. The levels available are:

 

               TRACE

               DEBUG

               INFO

               WARN

               ERROR

               FATAL
 

 

Setting the level to DEBUG will increase the amount off logging information, it's advised to leave the log level set to INFO.
TRACE is the lowest level and will log everything, FATAL is the highest level and will only log FATAL message.

 

You can also change increase the logging information from specific namespace within the IM Sequencer:

 

               <!-- Print only messages of level defined in the package Traxion.IM.Sequencer.Client -->

               <logger name="Traxion.IM.Sequencer.Client">

                       <level value="INFO" />

               </logger>

 

The above configuration tells the logging system to process only INFO or higher messages.

 

To disable the entire logging change:

 

       <log4net threshold="ALL">

 

To

       <log4net threshold="OFF">

 

IM Sequencer Service

 

The logging configuration for the IM Sequencer Service is defined in the file "IM Sequencer Service.exe.config" This file can be found in the IM Sequencer installation directory (default location "<Installation Directory>\Traxion\IM Sequencer")

 

Event logging

 

The IM Sequencer Service logs important entries to the Event log from the Windows System. The IM Sequencer Service can log the following events. The Eventlog category is "IM Sequencer Service", you can apply a filter on this source to gather all events from the IM Sequencer Service.

 

Event Id

Explanation

1

The IM Sequencer Service has been started.

2

The working directory from the IM Sequencer Service could not be resolved.

3

The IM Sequencer Service has been stopped.

4

The IM Sequencer Service could not write it's log4net information.

5

The IM Sequencer Service has encountered an unhandled exception, contact Traxion Support.

6

The IM Sequencer Service has started but could not locate the file than contains the configured Tasks.

7

The scheduled Task {id} has been started.

8

The scheduled Task {id} has finished successfully

9

The scheduled Task {id} has finished but there are errors.

 

 

Plain log

 

Below is an example Log4Net configuration displayed:

 

<!-- This section contains the log4net configuration settings -->

<!-- Set threshold to OFF to disable logging -->

<log4net threshold="ALL">

  <!-- Eventlog appender. Only logs ERROR and FATAL -->

  <appender name="Eventlog" type="log4net.Appender.EventLogAppender">

    <param name="LogName" value="Application" />

    <param name="ApplicationName" value="IM Sequencer Service" />

    <filter type="log4net.Filter.LevelRangeFilter">

      <param name="LevelMin" value="ERROR" />

    </filter>

    <layout type="log4net.Layout.PatternLayout">

      <conversionPattern value="%message" />

    </layout>

  </appender>

 

  <!-- Appender for sending snmp traps -->

  <appender name="NetworkManagement" type="Traxion.IM.Library.Logging.Appenders.SnmpAppender, Traxion.IM.Library">

    <ManagementServerAddress value="Provide ip or address for the SNMP server" />

    <ManagementServerListenPort value="Provide port that the SNMP server listens on" />

    <LocalAgentAddress value="127.0.0.1" />

    <EnterpriseOid value="1.3.6.1.4.1.24.0" />

    <!--Valid values are ColdStart, WarmStart, LinkDown, LinkUp, AuthenticationFailure, EgpNeighborLoss, EnterpriseSpecific -->

    <GenericTrapType value="EnterpriseSpecific" />

    <SpecificTrapType value="0" />

    <CommunityString value="public" />

    <ApplicationTrapOid value="1.3.6.1.4.1.24.12.10.22.64" />

    <!-- Valid versions are V1 and V2 -->

    <Version value="V1" />

 

    <threshold value="ERROR" />

    <layout type="log4net.Layout.PatternLayout">

      <!-- Pattern to output the caller's file name and line number -->

      <conversionPattern value="%date [%level] %type.%method{1} - %message" />

    </layout>

  </appender>

 

  <!--

  Debugger appender used for tracing. Logs ALL (uncomment if tracing is required).

  To catch all messages which are send to the debugger run DebugView for Windows (http://www.microsoft.com/technet/sysinternals/utilities/debugview.mspx)

  -->

  <!--<appender name="Debugger" type="log4net.Appender.OutputDebugStringAppender">

    <layout type="log4net.Layout.PatternLayout">

      <conversionPattern value="[%level] %type.%method{1} - %message" />

    </layout>

  </appender>-->

 

  <!-- Define console appender, all messages are logged to the console -->

       <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >

               <layout type="log4net.Layout.PatternLayout">

                   <conversionPattern value="%date [%level] %type.%method{1} - %message  %newline " />

               </layout>

       </appender>

 

  <!--Define rolling file appender, maximum log file size is 100 mb (10 x 10 mb)-->

       <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">

               <file value="Log\Sequencer_Service.log" />

               <appendToFile value="true" />

               <rollingStyle value="Size" />

               <maxSizeRollBackups value="10" />

               <maximumFileSize value="10MB" />

               <staticLogFileName value="true" />

               <layout type="log4net.Layout.PatternLayout">

                       <header value="Start logging&#13;&#10;" />

                       <footer value="Stop logging&#13;&#10;" />

                     <conversionPattern value="%date [%level] %type.%method{1} - %message  %newline " />

               </layout>

       </appender>

       

       <!-- Setup the root category, add the appenders and set the default level -->

       <root>

               <!-- Possible values are FATAL, ERROR, WARN, INFO, DEBUG or TRACE-->

            <!-- Active log appenders. If tracing is required uncomment 'Debugger' -->

               <level value="INFO" />

               <appender-ref ref="Eventlog" />

             <!--<appender-ref ref="Debugger" />-->

             <!--<appender-ref ref="NetworkManagement" />-->

             <appender-ref ref="ConsoleAppender" />

             <appender-ref ref="RollingFileAppender" />

       </root>

       <!-- Print only messages of level defined in the package Traxion.IM.Library -->

       <logger name="Traxion.IM.Library">

               <level value="INFO" />

       </logger>

       <!-- Print only messages of level defined in the package Traxion.IM.Scheduler -->

       <logger name="Traxion.IM.Scheduler">

               <level value="INFO" />

       </logger>

</log4net>

 

The explanation for the configuration is explained in the previous part.

 

SNMP Appender

 

Within the libraries provided by the IM Sequencer is an log4net appender especially for sending SNMP traps.

 

Below is an example for the SNMP configuration:

 

  <!-- Appender for sending snmp traps -->

  <appender name="NetworkManagement" type="Traxion.IM.Library.Logging.Appenders.SnmpAppender, Traxion.IM.Library">

    <ManagementServerAddress value="Provide ip or address for the SNMP server" />

    <ManagementServerListenPort value="Provide port that the SNMP server listens on" />

    <LocalAgentAddress value="127.0.0.1" />

    <EnterpriseOid value="1.3.6.1.4.1.24.0" />

    <!--Valid values are ColdStart, WarmStart, LinkDown, LinkUp, AuthenticationFailure, EgpNeighborLoss, EnterpriseSpecific -->

    <GenericTrapType value="EnterpriseSpecific" />

    <SpecificTrapType value="0" />

    <CommunityString value="public" />

    <ApplicationTrapOid value="1.3.6.1.4.1.24.12.10.22.64" />

    <!-- Valid versions are V1 and V2 -->

    <Version value="V1" />

 

    <threshold value="ERROR" />

    <layout type="log4net.Layout.PatternLayout">

      <!-- Pattern to output the caller's file name and line number -->

      <conversionPattern value="%date [%level] %type.%method{1} - %message" />

    </layout>

  </appender>

 

You need to specify some information for the appender to work:

 

ManagementServerAddress:         This could be a IP number or an address pointing to the management server that is listing for SNMP messages

ManagementServerListenPort:         This is the portnumber where the management server is listening to

 
All other values can be left default and depends on your management server configuration on how you want to filter.
 
The Threshold value indicates that only messages from the level "ERROR"  and "FATAL" are being send to this appender. All other filtering options from log4net can be applied within this appender.

For more information about the log4net appenders check http://logging.apache.org/log4net/release/manual/configuration.html#appenders

 

The appender is included by default in the IM Sequencer client and the IM Sequencer service logging configuration, you only need to uncomment the appender in the <root> tag.

 


Page url: http://www.traxionsolutions.com/imsequencer/help/index.html?imsequencerlogging.htm