You can manage the FCS logs through a standard logging system and easily control log
levels and appenders. With the FCS standard logging system, you can enable traces
without restarting the FCS server and use circular logs.
The FCS logging infrastructure relies on SLF4J Logback which is the default logging
framework. You can change the log level by editing the logback.xml file generated at
installation. By default, the SLF4J Logback checks the logback.xml file every 30
seconds for changes. You do not need to restart the server when you change the log
level, just update the logback.xml file and wait 30 seconds to view your changes.
The location of the logback.xml file is:
- For the web server installation:
webapps/$SERVER_URI/WEB-INF/classes/logback.xml
- For the modelingStudio/Collaboration server installation:
$OS/docs/javacommon/logback.xml
To change the levels and appenders of the FCS logger, add the following element to
the logback.xml file:
<logger name="FCS" level="LOG-LEVEL">
<appender-ref ref="APPENDER-NAME" />
<logger>
where:
APPENDER-NAME is defined in the Logback documentation
http://logback.qos.ch/manual/.
LOG-LEVEL must be one of the following:
-
ALL
-
TRACE
-
DEBUG
-
INFO
-
WARN
-
ERROR
-
OFF
For FCS log messages, in the context of an FCS ticket created on an MCS, with a log
level at least DEBUG or activated through MQL, log message level are raised up to
the INFO log level, if needed. In this case, the default Logback configuration
dynamically dumps logs.
You can also use JMX to change log levels through the JConsole.
To enable JMX on the Web server, add the following option on the Java launch command
line:
-Dcom.sun.management.jmxremote.port=5522
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
For more information about JMX, see the JMX documentation.
Example of Activating FCS for the DEBUG Level
This is the logback.xml file with the log level set to DEBUG:
<?xml version="1.0" encoding="UTF-8" ?>
<configuration scan="true" scanPeriod="30 seconds">
<jmxConfigurator />
<property file="E:/tmp/TestCD216/server/win_b64/code/bin/enovia.ini"/>
<define name="pid" class="com.matrixone.util.PIDPropertyDefiner"/>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS,GMT} GMT ${HOSTNAME} [%thread] %-5level %logger{64} - %msg%n
</pattern>
</encoder>
</appender>
<appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern> ${MX_TRACE_FILE_PATH}/${MX_TRACE_FILE_NAME:-platform}_${pid}_%d{yyyy-MM-dd}_%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>64MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS,GMT} GMT ${HOSTNAME} [%thread] %-5level %logger{64} - %msg%n
</pattern>
</encoder>
</appender>
<logger name="FCS" level="DEBUG">
<appender-ref ref="STDOUT" />
</logger>
<root level="INFO">
<appender-ref ref="ROLLING" />
</root>
</configuration>