Logging
ImportClient uses the Apache Log4j version 2 framework for its logging. By default ImportClient looks for a file named log4j2.xml in the same folder as itself, if no such file is found ImportClient defaults to a built in generic version of log4j2.xml. The standard log4j2.xml that is included in the ImportClient package at downloadportal.easit.com looks as shown below. Feel free to copy and use this example if you need to.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
Elements / Properties and Attributes of interest
Configuration/Properties
- log-path - Relative path where logs are stored.
- default-log-pattern - Specifies the layout within the log. Can be customized to better match a log collecting system.
- default-max-log-files - How many log files are saved. When this value is reached the oldest will be removed.
- default-max-log-age - How long log files are saved. When this value is reached the oldest will be removed.
- default-log-name - Name of log file and trace log file.
Configuration/Appenders/RollingFile name="FILE"
- Attribute:fileName - Full path and name to log file.
- Attribute:filePattern - Pattern for log file name when rotating logs.
Configuration/Appenders/RollingFile name="FILETRACE"
- Attribute:fileName - Full path and name to trace log file.
- Attribute:filePattern - Pattern for log file name when rotating trace logs.
Configuration/Loggers/Root
- Attribute:level - Base level for all logging
- appender-ref - Can be used to override the base level logging for each appender.
In our example above INFO-level and higher messages are logged to importclient.log and if you are running ImportClient in a console you will get DEBUG-level and higher messages.