Configuring Logging for the eG RUM Collector

The logging level of the collector-related log files, the format of the log entries, and the maximum size up to which these log files can grow, can be custom-defined in the logback.properties file in the <EG_RUM_DATA_COLLECTOR_INSTALL_DIR>\tomcat\webapps\rumcollector\web-inf\lib directory (on Windows; on Unix, this will be the /opt/rum/tomcat/webapps/rumcollector/WEB-INF/lib directory).

Typically, the collector logs can be configured with one of the following log levels: ALL or TRACE, DEBUG, INFO, WARN, ERROR. Each of these log levels and their significance has been discussed below:

  • ALL or TRACE: Setting the log level to ALL or TRACE enables the logger to log detailed information pertaining to the events logged. Moreover, once the log level is set to ALL or TRACE, then DEBUG, INFO, WARN, and ERROR messages will also be logged in the log files.
  • DEBUG: Set the log level to DEBUG to make sure that DEBUG messages are logged in the log file. Using such messages, you can easily troubleshoot issues related to the operations of the RUM collector. Once the log level is set to DEBUG, then, INFO, WARN, and ERROR messages will also be logged in the log files. However, detailed event information provided by the ALL or TRACE level will not be available for the DEBUG level.
  • INFO: To capture general information messages, set the log level to INFO. In this case, besides INFO messages, WARN and ERROR messages will also be logged in the log files.
  • ERROR: By setting the log level to ERROR, you can make sure that only error messages are captured by the log files.

By default, the collector logs are configured with the DEBUG log level. This is why, the log_level parameter in the logback.properties file is set to DEBUG by default. Depending upon the types of events you want captured and the level of information you want logged in the log file, you can change the value of the log_level parameter to any of the levels described above.

Besides the log level, you can also configure log rolling using the logback.properties file. By configuring a size (in MB) against the log_file_size parameter, you can indicate the maximum size up to which a log file can grow. Beyond that point, all entries from the log file will be automatically copied to a new log file, and all subsequent messages will be logged in the old log file. For instance, if the log_file_size parameter is set to 5 (MB), then messages will be logged in the agent_data log file (for example), only until the file becomes 5 MB in size. After this point, a new log file named agent_data1 will be created, to which all entries from the agent_data log will be copied. This way, by default, a maximum of 20 files will be created. This is governed by the log_file_count parameter, with the default value 20. You can increase or decrease the value of this parameter depending upon how many times you want the log files to roll.

You can also configure the format in which events are to be logged in the log files using the log_pattern parameter in the logback.properties file. By default, this parameter is set to the following format:

%date %-5level {%C %M} - [%L] - %msg%n

Here, %date refers to the date/time of the event. %-5level indicates the log level. %C indicates the class name, %M denotes the method name, %L signifies the line number, and %msg refers to the message.

You can change the log file pattern to remove or reposition any of the tags mentioned above.

A sample log file output is provided below:

2015-08-14 16:32:08,363 DEBUG {com.eg.RumMeasureData doPost} - [212] - Reading data from renamed service file !!! [C:\egurkha\manager\tomcat\webapps\rumcollector\/WEB-INF/rum/data/For_OOME-1439550128151]

Here:

2015-08-14 16:32:08,363 is the date/time of the event.

DEBUG is the log level

com.eg.RumMeasureData is the class name

doPost is the method

212 is the line number

Reading data from renamed service file !!! [C:\egurkha\manager\tomcat\webapps\rumcollector\/WEB-INF/rum/data/For_OOME-1439550128151] is the message