Creating custom log level categories
Create a custom log category to track specific troubleshooting information in PingAccess, if it’s available for collection.
Steps
-
In the
<pa_home>/conf/log4j-categories.xml
file, go to the logCategories section and add a new category entry.Use the following syntax:
<category id=“” name=“” offLevel=“” onLevel=“” description=“”>
where:- category id
-
Is the logger’s reference name. This value must be a unique alphanumeric string.
You will use the category id in step 3.
- name
-
Is the logger’s nickname. This value appears in the admin console, so it should be descriptive enough to identify the logger.
- offLevel
-
Is the default log level that’s used when the category is deselected in the admin console. Valid values are:
-
FATAL
-
ERROR
-
WARN
-
INFO (recommended)
-
DEBUG
-
TRACE
You will use the offLevel in step 3.
-
- onLevel
-
Is the log level that’s used to troubleshoot issues when the category is selected in the admin console. Valid values are:
-
FATAL
-
ERROR
-
WARN
-
INFO
-
DEBUG (recommended)
-
TRACE
-
- description
-
Is the unique description for the logger. This description appears in the admin console.
-
Save and close the
log4j-categories.xml
file. -
Open the
<pa_home>/conf/log4j2.xml
file, go to theLoggers
section, and add a logger entry.Use the following syntax:
<Logger name=“” level=“${sys:pa.log.level.<categoryid>:-<offLevel>}”/>
where:- sys:pa.log.level
-
Is a constant value for all logger entries.
- <categoryid>
-
Is the id value from the category entry. This value is case sensitive.
- <offLevel>
-
Is the default starting logging level.
This value should match the offLevel value in the category entry.
-
Save and close the
log4j2.xml
file. -
If you are running PingAccess in clustered mode, copy both files to each PingAccess instance in the cluster that you want to apply the settings to.
-
Restart PingAccess.
Result
The Log Settings page displays the new categories, and you can select or deselect those categories as described in Configuring verbose logging in the admin console.