RSC200111: Logging Options for RaySuite Products

Besides the product configuration options that are available in the Settings section of the UI of the different Raynet applications, there are some additional configuration settings that users can adjust to tailor RaySuite products towards their individual requirements.

Logging the applications activity

The program data directory ,as defined in the table below, is used by default to store the application activity log file. If the default settings remain unchanged, the RaySuite application adds a new line to this log file for every system DEBUG level message that is generated during application use.

By default, the log is to be used as in a rolling appender manner, which means that one global log file is permanently extended until a certain file size is reached. As soon as it is reached, the oldest lines are automatically transferred into an archive of log files, which, by default, is limited to 10 files. When this second limit is reached, the oldest archive is removed to free a slot for the newest archive file.

 

  Path to logfile log file name Installation folder .config file name
RayQC C:\Users\<username>\AppData\Roaming\RayQC\Logs dd-MM-yyyy-HH-mm-ss.log  C:\Program Files (x86)\RayPackStudio\RayQC log4net.config
RayQC Advanced

C:\Users\<username>\AppData\Roaming\RayQCAd\Logs

dd-MM-yyyy-HH-mm-ss.log C:\Program Files (x86)\RayPackStudio\RayQC log4net.config
RayEval C:\Users\<username>\AppData\Roaming\RayEval\Logs dd-MM-yyyy-HH-mm-ss.log  C:\Program Files (x86)\RayPackStudio\RayEval log4net.config
RayPack

C:\Users\<username>\AppData\Roaming\RayPack\Logs

d-MM-yyyy-HH-mm-ss.log  C:\Program Files (x86)\RayPackStudio\RayPack log4net.config
PackBench

C:\Users\<username>\AppData\Roaming\PackBench\Logs

dd-MM-yyyy-HH-mm-ss.log C:\Program Files (x86)\RayPackStudio\PackBench log4net.config
RayFlow Client C:\Users\<username>\AppData\Roaming\RayFlow\Logs dd-MM-yyyy-HH-mm-ss.log  C:\Program Files (x86)\RayFlowClient log4net.config
RayVentory Scan Engine

C:\ProgramData\

Raynet\RayVentoryPortal\Results\Logs

RayVentoryScanEngineUserUI.yyyy-mm-dd.log,
RayVentoryScanEngineScheduler.log,

RayVentory.Http.Server.

yyyy.mm.dd.log

C:\Program Files (x86)\RayVentoryScanEngine
RayVentoryScanEngine.exe.config
RayVentoryScanEngine.HttpUploadServer.exe.config
RayVentoryScanEngineScheduler.exe.config
RayVentory.HostImport.Console.exe.config
RayVentory.VM.Console.exe.config
RemoteInventory4Unix.exe.config
RemoteWmiInventory.exe.config
SNMPTracker.exe.config

The exact path to the log file and the installation folder of the current RaySuite application instance can also be found in the 'TROUBLESHOOTING' tab which is located in the 'ABOUT' section of most of the RaySuite applications.

Example:

Logging_Options.PNG

In order to change the default settings for the log file behavior, users have to manually edit the .config (the exact name of the file depends on the application and can be found in the table below), which resides in the root of the installation folder of the RaySuite application (usually something like C:\Program Files (x86)\[APPLICATIONNAME]\). The settings which are most likely to be of interest for adjustments are:

Log file storage location

The log file is by default “%appdata%\Raynet\[APPLICATIONNAME]\Logs\[APPLICATIONNAME].log” or “%appdata%\[APPLICATIONNAME]\Logs\{yyyy-MM-dd HH-mm-ss}.log”. However, it is possible to define any other absolute local paths as well as shared network locations for logging resource storage.

<file type="log4net.Util.PatternString"

        value="%env{AppData}\\Raynet\\[APPLICATIONNAME]\\Logs\\%date{yyyy-MM-dd HH-mm-ss}.log" />

or

<file type="log4net.Util.PatternString"

        value="%env{AppData}\\[APPLICATIONNAME]\\Logs\\%date{yyyy-MM-dd HH-mm-ss}.log" />

Please keep in mind, that the user that runs the RaySuite application must have write permissions in the log file location in order to initiate and maintain the message flow to the log file. If the user does not have sufficient access rights, there will be no error message or actual product usage cutback, but simply a loss of system activity documentation. Please refer to the Troubleshooting section for additional instructions in case of missing logs.

Max. log file size

The max. log file size may be defined as "KB", "MB" or "GB". The default setting for newly installed RaySuite application instances is "2048KB"

<maximumFileSize value="2048KB" />

Log level

The most frequently used log level settings are DEBUG, INFO, WARN, ERROR, FATAL, OFF, whilst OFF prevents logging at all, FATAL is the most restrictive but still writing setting, and DEBUG the most talkative option.

The recommendation is to use the DEBUG level for newly setup systems, since a lot of the information logged in this mode may help to adjust settings regarding access rights, and the like. As soon as the application and system are up and running productively, setting the log level to WARNING should be sufficient for permanent maintenance.

<level value="DEBUG" />

Default logging configuration of all RaySuite products

The default configuration files are given below as a review and backup support.

RayQC:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

 

<configSections>
   <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>

   <log4net>

      <appender name="RayQC" type="log4net.Appender.RollingFileAppender">
         <file type="log4net.Util.PatternString"
            value="%env{AppData}\\RayQC\\Logs\\%date{yyyy-MM-dd HH-mm-ss}.log" />

         <rollingStyle value="Once" />
         <maxSizeRollBackups value="2" />
         <maximumFileSize value="10240KB" />
         <staticLogFileName value="false" />
         <immediateFlush value="true" />
         <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="header" value="/***************************** LOG HEADER *****************************/&#xD;&#xA;"/>
            <param name="footer" value="/***************************** LOG FOOTER *****************************/&#xD;&#xA;"/>
            <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
         </layout>
         <threshold value="INFO" />
      </appender>

      <root>
         <level value="ALL" />
         <appender-ref ref="RayQC" />
      </root>

   </log4net>
</configuration>

 

RayQC Advanced:

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

  <configSections>

    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>

  </configSections>

  <log4net>

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

      <immediateFlush value="true" />

      <file type="log4net.Util.PatternString" value="%property{LogFilePath}\%date{dd-MM-yyyy-HH-mm-ss}.log" />

      <param name="StaticLogFileName" value="false" />

      <maximumFileSize value="10MB" />

      <rollingStyle value="Once" />

      <maxSizeRollBackups value="2" />

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

        <param name="header" value="/***************************** LOG HEADER *****************************/&#xD;&#xA;"/>

        <param name="footer" value="/***************************** LOG FOOTER *****************************/&#xD;&#xA;"/>

        <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />

      </layout>

      <threshold value="INFO" />

    </appender>

    <root>

      <level value="INFO" />

      <appender-ref ref="RayQCAdvanced" />

    </root>

  </log4net>

</configuration>

RayPack:

<?xml version="1.0" encoding="utf-8" ?>

   <configuration>
      <configSections>
         <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
      </configSections>

      <log4net>
         <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
            <layout type="log4net.Layout.PatternLayout">
               <IgnoresException value="False" />
               <conversionPattern value="[%-5p] - %m%n" />
            </layout>
         <threshold value="INFO" />
      </appender>
      <appender name="RayPackFileAppender" type="log4net.Appender.RollingFileAppender">
         <immediateFlush value="true" />
         <file type="log4net.Util.PatternString" value="%property{LogFilePath}\%date{yyyy-MM-dd-HH-mm-ss}.log" />
         <param name="StaticLogFileName" value="false" />
         <maximumFileSize value="10240KB" />
         <rollingStyle value="Once" />
         <maxSizeRollBackups value="2" />
         <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="header" value="/***************************** LOG HEADER *****************************/&#xD;&#xA;" />
            <param name="footer" value="/***************************** LOG FOOTER *****************************/ " />
            <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
         </layout>
         <threshold value="INFO" />
         <encoding value="utf-8" />
      </appender>
      <root>
         <level value="INFO" />
         <appender-ref ref="ConsoleAppender" />
         <appender-ref ref="RayPackFileAppender" />
      </root>
   </log4net>
</configuration>

 

RayFlow Client:

 

  <log4net>

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

      <file type="log4net.Util.PatternString" value="%property{LogDirectory}\Rayflow.log" />

      <appendToFile value="true" />

      <rollingStyle value="Size" />

      <maxSizeRollBackups value="10" />

      <maximumFileSize value="10MB" />

      <staticLogFileName value="true" />

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

        <conversionPattern value="%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n" />

      </layout>

    </appender>

    <root>

      <level value="DEBUG" />

      <appender-ref ref="RollingFile" />

    </root>

  </log4net>

RayEval:

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

    <configSections>

        <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>

    </configSections>

    <log4net>

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

            <immediateFlush value="true" />

            <file type="log4net.Util.PatternString" value="%property{LogFilePath}\%date{dd-MM-yyyy-HH-mm-ss}.log" />

            <param name="StaticLogFileName" value="false" />

            <maximumFileSize value="10240KB" />

            <rollingStyle value="Once" />

            <maxSizeRollBackups value="2" />

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

                <param name="header" value="/***************************** LOG HEADER *****************************/&#xD;&#xA;"/>

                <param name="footer" value="/***************************** LOG FOOTER *****************************/&#xD;&#xA;"/>

                <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />

            </layout>

            <threshold value="INFO" />

        </appender>

 

        <root>

            <level value="ALL" />

            <appender-ref ref="RayEval" />

        </root>

    </log4net>

</configuration>

PackBench:

<?xml version="1.0" encoding="utf-8"?>

<configuration>

  <configSections>

    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />

  </configSections>

  <log4net>

      <appender name="ConsoleAppender" type="log4net.Appender.ColoredConsoleAppender">
         <layout
type="log4net.Layout.PatternLayout">
            <conversionPattern
value="[%-5p] - %m%n" />
         </layout>
         <threshold
value="Info" />
         <mapping>
            <level
value="DEBUG" />
            <foreColor
value="Yellow" />
         </mapping>
         <mapping>
            <level
value="INFO" />
            <foreColor
value="White" />
         </mapping>
         <mapping>
            <level
value="ERROR" />
            <backColor
value="Red, HighIntensity" />
            <foreColor 
value="White" />

         </mapping>
         <mapping>
            <level
value="WARN" />
            <foreColor
value="Red" />
         </mapping>
      </appender>
   <!--<appender name="EventLogAppender" type="log4net.Appender.EventLogAppender" >
         <applicationName value="PackBench Service" />
         <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%d [%t] %-5p %c - %m%n" />
            <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
         </layout>
      </appender>-->

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

      <immediateFlush value="true" />

      <file type="log4net.Util.PatternString" value="%property{LogFilePath}\%date{dd-MM-yyyy-HH-mm-ss}.log" />

      <param name="StaticLogFileName" value="false" />

      <maximumFileSize value="10240KB" />

      <rollingStyle value="Once" />

      <maxSizeRollBackups value="2" />

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

        <param name="header" value="/***************************** LOG HEADER *****************************/&#xD;&#xA;" />

        <param name="footer" value="/***************************** LOG FOOTER *****************************/&#xD;&#xA;" />

        <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />

      </layout>

      <threshold value="INFO" />

    </appender>

    <root>

      <level value="INFO" />

      <appender-ref ref="ConsoleAppender" />

      <appender-ref ref="RayBenchFileAppender" />

    </root>

  </log4net>

</configuration>

RayVentory Scan Engine

</configuration>

<?xml version="1.0" encoding="utf-8"?>

  <configuration>

...

    <log4net level="info">
      <logger name="RayVentory">
        <level value="INFO" />
      </logger>

  <appender name="EventLogAppender" type="log4net.Appender.EventLogAppender">
     <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
    </layout>
   <threshold value="ERROR" />
</appender>

<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender">
  <immediateFlush value="true" />
   <file type="log4net.Util.PatternString" value="%property{PathToLog}\" />
  <datePattern value="'RayVentoryScanEngineUserUI.'yyyy-MM-dd'.log'" />
  <param name="StaticLogFileName" value="false" />
  <maximumFileSize value="10240KB" />
  <maxSizeRollBackups value="100" />
  <layout type="log4net.Layout.PatternLayout,log4net">
  <param name="header" value="/***************************** LOG HEADER *****************************/ " />
  <param name="footer" value="/***************************** LOG FOOTER *****************************/ " />
  <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
  </layout>
  <threshold value="INFO" />
</appender>

<appender name="Console" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%d %-5p - %m%n" />
</layout>
</appender>

  <root>
    <level value="INFO" />
    <appender-ref ref="LogFileAppender" />
    <appender-ref ref="EventLogAppender" />
    <appender-ref ref="Console" />
  </root>

  </log4net>

  <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /></startup>

</configuration>

 

Further Information

RaySuite applications use an external library to provide logging functionality. Please refer to the online-documentation provided for the log4net project (http://logging.apache.org/log4net/) in order to get further details regarding available configuration and usage options. log4net can be adjusted to connect directly with databases or event-loggers. There are numerous options for layout and behavior manipulations. RaySuite application system administrators with a slight affection for perfection are highly welcome to configure their very own logger version.

 

 

Comments

Powered by Zendesk