Page History
...
- In the Java application server (on which Web Application Platform runs) home directory, go to the shared > conf folder. For example, if you use Apache Tomcat, go to <tomcat_home>\shared\conf.
- Using a plain text editor create the logback.xml file in that directory.
Copy and paste the following text to the logback.xml file:
Code Block linenumbers true <?xml version="1.0" encoding="UTF-8"?> <configuration> <contextName>webapp</contextName> <jmxConfigurator/> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</Pattern> </encoder> </appender> <appender name="WEBAPPPLATORM_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <append>true</append> <file><tomcat_home>\logs\webappplatform\webappplatform.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <!-- rollover daily --> <fileNamePattern>webappplatform.%d{yyyy-MM-dd}.%i.log</fileNamePattern> <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB --> <maxFileSize>20MB</maxFileSize> <maxHistory>60</maxHistory> <totalSizeCap>1GB</totalSizeCap> </rollingPolicy> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <pattern>%date [%thread] %-5level %logger - %msg%n</pattern> </encoder> </appender> <appender name="TWC_RESPONSE_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <append>true</append> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <pattern>%date [%thread] %-5level %logger - %msg%n</pattern> </encoder> <file><tomcat_home>\logs\webappplatform\twc_response.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <file><tomcat_home>\logs\webappplatform\twc_response.log</file> <!-- rollover daily --> <fileNamePattern>twc_response.%d{yyyy-MM-dd}.%i.log</fileNamePattern> <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB --> <maxFileSize>20MB</maxFileSize> <maxHistory>60</maxHistory> <totalSizeCap>1GB</totalSizeCap> </rollingPolicy> </appender> <logger name="TWC_RESPONSE_LOGGER" level="debug"> <appender-ref ref="TWC_RESPONSE_FILE" /> </logger> <logger name="com.nomagic.webappplatform" level="debug"> <appender-ref ref="WEBAPPPLATORM_FILE" /> </logger> <logger name="com.nomagic.webappplatform.collaborator.licensing.LicensingService" level="debug"> <appender-ref ref="STDOUT" /> </logger> </configuration>
Tip title Described appenders The logback.xml file describes three appenders between the <appender> tags. The STDOUT appender is used when logging data to the console. The WEBAPPPLATORM_FILE and TWC_RESPONSE_FILE appenders are used when logging data to the webappplatform.log and twc_response.log files.
- Specify the following properties for the WEBAPPPLATORM_FILE and TWC_RESPONSE_FILE appenders:
- Full paths to the log files (between the <file> tags). To specify a path, replace the <tomcat_home> placeholder in the path with the home directory of the Java application server that Web Application Platform runs on.
- File name patterns of the log files (between the <fileNamePattern> tags). You can leave the default file name pattern values.
- Maximum log file sizes (between the <maxFileSize> tags. You can leave the default maximum file size values.
- Maximum history in days (between the <maxHistory> tags). You can leave the default maximum history values.
- Total size capacity (between the <totalSizeCap> tags). You can leave the default total size capacity values.
- Specify one of the following logging levels for the TWC_RESPONSE_LOGGER and "com.nomagic.webappplatform" loggers or leave the default value "debug":
all - designates events of all the levels including custom levels.
debug - designates fine-grained informational events that are most useful to debug an application.
error - designates error events that might still allow the application to continue running.
fatal - designates very severe error events that will presumably lead the application to abort.
info - designates informational messages that highlight the progress of the application at coarse-grained level.
trace - designates finer-grained informational events than "debug".
warn - designates potentially harmful situations.
off - turns logging of.
Note title Specifying logging levels The logback.xml file has three loggers. The TWC_RESPONSE_LOGGER logs data to the twc_response.log file, the "com.nomagic.webappplatform" logger logs data the webappplatform.log file, and the "com.nomagic.webappplatform.collaborator.licensing.LicensingService" logger logs data to the console.
You can change any of the levels listed above for each logger. By default, all logging levels are "debug".
- Save and close the logback.xml file.
- Restart the Java application server.
How to turn off logging
You can disable data logging to a specific file by changing the logging level of the related logger.
...