Default configuration of Loggers. The configuration will be applied in the following order:
- Hard coded configuration from the code
- On top of that the configuration from 'ifs-logging.properties' will be merged
- Further more configuration from a file specified by system property 'fndext.loggingConfig' will be merged
The configuration files are located in
IFS configuration directory
.
All the configuration files are optional and don't need to contain all the configuration parameters.
Configuration files are typical properties files. Following properties are allowed:
- global.level=<level>
- <category>.level=<level>
- handler.<name>.type=<type>
- handler.<name>.filename=<filename>
- handler.<name>.filecount=<count>
- handler.<name>.maxsize=<limit>
- handler.<name>.perthread=true | false
- handler.<name>.pertag=true | false
- handler.<name>.level=<level>
- handler.<name>.categories=[!]<category_list>
- handler.<name>.filter[.<no>]=[!]<filterclass>,<arguments>
- handler.<name>.includepackage=true | false
- classdebug.<java-class-name>=<level>
where:
- <level> can be one of following: 'error', 'warning', 'info', 'trace', 'debug'
- <category> can be one of: 'database', 'application', 'framework', 'gateway',
'callsequence', 'request', 'response', 'security', 'integration', 'batchprocessor',
'authentication', 'dbidprovider', 'timings'
- <name> is a name of the handler
- <type> can be one of: 'console', 'textfile', 'xmlfile'
- <filename> is file specification in the current OS manner. For available file name patterns refer to documentation
for java.util.logging.FileHandler class. A <filename> may contain references to the following substitution
variables: @IFS_HOME@, @IFS_INSTANCE@, @IFS_CONFIG_DIR@, @IFS_MWS_SERVER@. The variables will be replaced with the current values of
the corresponding system properties defined by class
IfsConstants
.
- <count> is the number of files to use for file rotation. Must be 1 or more. By default the
file number will be added before the file extension, but can be user-defined by using the '%g' placeholder in the file name.
- <limit> is the maximum number of bytes to write to any one file. Modifiers 'K', 'M' and 'G',
meaning 'kilobytes', 'megabytes' and 'gigabytes', are accepted after the number. Zero means 'no limit'.
- <category_list> is a comma separated list of categories. Also word 'classdebug' allowed as category here. If the list is
preceded with the exclamation mark, the meaning will be: all categories except the specified ones.
- <no> is an optional sequence number used if several filters are supposed to be defined. This is an integer greater then zero,
unique for each filter definition. If used, filters will be applied according to this sequence number.
- <filterclass> is the fully qualified class name of the filter. If the class name is preceded with the exclamation mark,
the filter behavior will be opposite, i.e. it will exclude the log records that satisfy condition and include all the others.
- <arguments> is a comma separated list of arguments required by the filter. Empty values are not allowed! Refer to the filter
documentation for specification of arguments.
- <java-class-name> is the fully qualified name of a java class that supports class debugging
It is possible to have arbitrary number of handlers. File name specification for a handler
of type 'console' is ignored, but is required for both 'textfile' and 'xmlfile'. File count and size limit specifications
are optional and will be ignored for 'console' handlers. If not specified, default values are: no size limit and 10 files.
By default a handler will process all output coming from all Loggers, but it can be limited
to a particular level and/or category/categories
Parameter 'perthread', if set to 'true' and type is one of 'xmlfile' or 'textfile', will cause creation of separate files per thread.
The thread ID can be denoted by '%T' placeholder. If not found, the placeholder will be put at the beginning of the file name. If the
value of this parameter is 'false', which is default, the placeholder will be ignored. For 'console' type the '%T' placeholder will
be ignored.
Parameter 'pertag', if set to 'true' and type is one of 'xmlfile' or 'textfile', will cause creation of separate files per specified tag.
The tag name can be denoted by '%G' placeholder. If not found, the placeholder will be put at the end of the file name. If the
value of this parameter is 'false', which is default, the placeholder will be ignored. For 'console' type the '%G' placeholder will
be ignored.
Category specific level will be applied only if more detailed then the global one.
Additional functionality is available through some management methods (JMX):
- Re-read configuration file. Forces to read and apply the configuration file changes
without restarting the server.
- Add a new, non-persistent handler by giving it's definition. Modification of existing handlers
this way is not possible.
- Remove previously added non-persistent handlers by supplying a comma separated list of handler names.
It is not possible to remove handlers defined in the configuration file this way.
- Add a non-persistent class logger. Class logger definition is given on form:
<fully_qualified_class_name>[=<log_level>]. Debug level is assumed if omitted.
- Remove a class logger by sending fully qualified class name.
Note that there is a risk for loosing some log entries for changed handlers when re-reading
the configuration file. This is because all files that got their definitions changed have to be closed
first before they can be open again based on the new definition.
String argument for creation of a new, non-persistent handler, using management
method has following syntax:
<handler_name>[;<param>...]
where <param> is on form 'key=value' ('key' can be shorten)
rules for file name for file based handlers:
- if not specified, '<handler_name>.log' is assumed in default location
- specified as 'value' with following 'keys':
'filename' (or 'file' or 'f') - file name in default location
'path' (or 'p') - absolute path
default file location is '@IFS_HOME@/instance/@IFS_INSTANCE@/logs/j2ee/@IFS_MWS_SERVER@'
other possible 'keys' (for 'values' refer to specification above):
'type' (or 't') - 'textfile' assumed if not present
'filecount' (or 'fcnt' or 'fc')
'maxsize' (or 'max' or 'm')
'perthread' (or 'th')
'pertag' (or 'tag')
'level' (or 'l')
'categories' (or 'cat' or 'c')
'filter' - 'value' can be preceed be filter number: '[<no>:]<filter_definition>
'includepackage' (or 'inclp' or 'i')
Boolean values can be shorten to 't' and 'f'.
Note also difference in specification of filter number in configuration file and here.