Question:
How can I change the logging behavior?
Answer:
storageRobot comes with a default configuration for logging the events that occur during program execution.
The logging is based on the Log4net library from the Apache Foundation. Further detailed information can be found here: https://logging.apache.org/log4net/release/manual/introduction.html
In most cases, however, you only want to make simple adjustments such as the number of log files or the maximum size of the log files.
Note:
Manually modifying the configuration file can cause a single configuration or the entire application to stop working or work incorrectly. Therefore, always create a backup copy of your configuration file before making any changes and be sure to use the exact spelling of parameters and values. You modify the configuration file at your own risk.
We have put together the following guidelines for you:
Stop all running storageRobot processes and administration. Also, if necessary, disable scheduled tasks and stop the Observer Service
Open the file log4net.config, which is located in the installation directory, with an editor such as Notepad++
Make the necessary adjustments. See more information further below.
Save the file.
If necessary, enable disabled scheduled tasks and start the Observer if it was previously stopped.
Changing the maximum size and number of log files
Search for the following section in the file:
<maxSizeRollBackups value=“5” />
<maximumFileSize value=“1MB” />
Change the value of the maxSizeRollBackups element, e.g. from “5” to “10”. This increases the number of simultaneously existing log files per configuration to 10.
Change the value of the maximumFileSize element from “1MB” to “5MB” to increase the size of a log file to 5 megabytes.
Changing the log level
By default, logging is always done in DEBUG mode. To log significantly less information, this mode can be changed to INFO. To do this, search for the following section in the file:
<root>
<level value=“DEBUG”/>
<appender-ref ref=“RollingFileAppender”/>
<appender-ref ref=“ColoredConsoleAppender” />
</root>
In the element level, change the value of the value attribute to “INFO”
Caution:
After this change, the information in the log file may no longer be sufficient to draw conclusions about the cause of possible errors.
Log level
The following log levels are available. The following log level includes all previous ones. Example: If you set WARN, then all messages with the type ERROR are also logged.
ERROR | All errors that occur. |
WARN | Warning messages indicate possible problems. However, we only use them very rarely in our programs. |
INFO | Informative messages that provide a rough overview of the application. |
DEBUG | All messages. Required for log files sent to support. |