Configuring the log files

The built-in logging module of JBoss EAP is used for the ConSol CM logging subsystem. Usually, no changes are required in a standard ConSol CM standalone installation.

The log files are saved under <JBOSS_HOME>/standalone/log.

The configuration of the logging subsystem is defined in one of the following files, depending on the infrastructure of your CM system:

Usually, you do not need to edit the XML files.

You can modify the default configuration in the respective configuration file:

For configuring the logging behavior, the following section of the configuration file is relevant:

<subsystem xmlns="urn:jboss:domain:logging:3.0">

Within the section of this subsystem, the file handlers are defined, each in a separate subsection. By default, periodic size rotating file handlers are used. One log file is created for every day. If the maximum size of 50 MB is exceeded, a new file is created for this day. 10 files are kept as backup.

Example from the index.log section:

<periodic-size-rotating-file-handler name="INDEX_FILE" autoflush="true">

<level name="${handler.indexfile.level:INFO}"/>

<formatter>

<pattern-formatter pattern="%d %-5.5p [%30.-30c] [%X{username}-%X{context}-%X{sessionId}] %m%n"/>

</formatter>

<file relative-to="jboss.server.log.dir" path="index.log"/>

<suffix value=".yyyy.MM.dd"/>

<max-backup-index value="${handler.indexfile.max.backup.index:10}"/>

<rotate-size value="${handler.indexfile.rotate.size:50m}"/>

<append value="true"/>

</periodic-size-rotating-file-handler>

Below the file handlers, the loggers are defined. For each logger, the target file(s) and the log level are provided.

<logger category="com.consol.cmas.core.index" use-parent-handlers="false">

<level name="${logger.com.consol.cmas.core.index.level:INFO}"/>

<handlers>

<handler name="INDEX_FILE"/>

</handlers>

</logger>

This means that the logger for classes belonging to com.consol.cmas.core.index writes into the file INDEX_FILE, which is defined in the file handler section above.

The variables in the syntax ${setting:value}, e.g. ${handler.indexfile.level:INFO}, indicate parameters which can be overridden in the <JBOSS_HOME>/bin/cm6-config.properties file.

Changing default settings

Please proceed as follows to modify logging settings:

  1. Locate the logging configuration in the cm6-<DB>.xml file or cm6-dwh-<DB>.xml
  2. Add entries with the desired values to the cm6-config.properties file.

The following example shows how to change default settings using the cm6-config.properties file.

Goal: You want to change the log level of the index.log file to DEBUG.

  1. Locate the respective handler in the configuration file (example from cm6-mysql-5.xml).

    <periodic-size-rotating-file-handler name="INDEX_FILE" autoflush="true">

    <level name="${handler.indexfile.level:INFO}"/>

    <formatter>

    <pattern-formatter pattern="%d %-5.5p [%30.-30c] [%X{username}-%X{context}-%X{sessionId}] %m%n"/>

    </formatter>

    <file relative-to="jboss.server.log.dir" path="index.log"/>

    <suffix value=".yyyy.MM.dd"/>

    <max-backup-index value="${handler.indexfile.max.backup.index:10}"/>

    <rotate-size value="${handler.indexfile.rotate.size:50m}"/>

    <append value="true"/>

    </periodic-size-rotating-file-handler>

  2. Locate the variable for the log level.

    This is ${handler.indexfile.level:INFO}.

  3. Add an entry for this variable to cm6-config.properties.

    # logging overrides

    handler.indexfile.level=DEBUG

Other changes you can make:

If there is no variable for a setting which you want to modify, you can edit the cm6-<DB>.xml or cm6-dwh-<DB>.xml file directly. This is required for example if you want to change the pattern for the log file entries (pattern-formatter attribute).