The instructions below cover how to create additional log files. The most common scenario of creating an additional log file is adding a secondary copy of the igx log file in a unique format. If you solely need to add debug messages to existing log files, please review Enabling debug logging for a specific class.
Creating a new log output type
This step creates a placeholder log output type. Log entries won't populate into the log output type until the Directing log entry types to an log output section is also completed.
- Access the admin console
- Click the Logging link within the admin console's left navigation
- Click the Manage Log Outputs button in the bottom right:
- Click New Log Output
- Specify a unique Name and File Path. Make note of this Name, as it will be used in additional steps.
- Save
Modifying the log output format
This step is optional and is only performed if your new log output format or settings will be changed. By default, logs use log4j's PatternLayout, with the pattern below:
%d{ISO8601} %-5p [%c] (%t): %m%n
If you are modifying the output type or syntax, it is recommended to do so before directing log entries to your new output. This will keep your new log file in a consistent format.
The examples below show how to update the out-of-the-box PatternLayout syntax and how to update the logs to an XML format.
Updating the log4j PatternLayout
Note that the the log4j records will appear multiple times, once per log output. The log output name will vary, and the record to update will contain the Name of the log output format from the prior section.
- Edit the following file:
<install home>/igx-data/<config name>/<product>/config/cee.log4j.properties
- Locate the following record:
log4j.appender.<your log output name>.layout.ConversionPattern=%d{ISO8601} %-5p (%t) [%c]%m%n
For example:log4j.appender.newlog.layout.ConversionPattern=%d{ISO8601} %-5p (%t) [%c]%m%n
- Modify the format following the syntax according to log4j's PatternLayout.
Updating the logs to XML format
Note that the the log4j records will appear multiple times, once per log output. The log output name will vary, and the record to update will contain the Name of the log output format from the prior section.
- Edit the following file:
<install home>/igx-data/<config name>/<product>/config/cee.log4j.properties
- Remove the following record:
log4j.appender.<your log output name>.layout.ConversionPattern=%d{ISO8601} %-5p (%t) [%c]%m%n
For example:log4j.appender.newlog.layout.ConversionPattern=%d{ISO8601} %-5p (%t) [%c]%m%n
If the ConversionPattern record isn't removed when updating to XMLLayout, warnings will populate in your logs due to an invalid property. - Modify the following record:
log4j.appender.<your log output name>.layout=org.apache.log4j.PatternLayout
To the following:
log4j.appender.<your log output name>.layout=org.apache.log4j.xml.XMLLayout
Directing log entry types to an log output
After a new log file is now created, no log entries will write to it by default. This step populates the new log output with log entries.
If not already present on in the Logging page, access the admin console and click the Logging link within the admin console's left navigation.
The top pane displays the following details:
- Classes: The Java package/classes for which output will be redirected. Specifying a package will include all classes within it.
- Severity: The threshold of log events to record.
- Log Output: The log output type(s) that will receive log events
If creating a new log output for a specific class for troubleshooting, follow the same instructions as Enabling debug logging for a specific class and select your new log type as the output. Your log output will show as the name chosen in the prior section.
If creating a new log output as a clone of the out-of-the-box igx log, update each class that has an output to iitap
to also output to your new log output type. iitap
represents the out-of-the-box log output type that outputs to the igx log. Your log output will show as the name chosen in the prior section and should append, not replace, the iitap
output:
Making the new log changes permanent
The instructions above result in a temporary log. The modifications will last until the next time update config or deploy is run. The instructions below will make the prior changes permanent.
- Make note of the following file location:
<install home>/igx-data/<config name>/<product>/config/cee.log4j.properties
- Follow the instructions within Using config override with the new
cee.log4j.properties
file above.
Comments
0 comments
Please sign in to leave a comment.