Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

If you want to log information about user actions in You can change the default data logging settings, including the logging level, for Web Application Platform , and Teamwork Cloud responses, and other technical data like Web Application Platform errors, you have to configure logging as described below.

To configure logging

...

Tip

Web Application Platform

...

Copy and paste the following text to the logback.xml file:

Code Block
linenumberstrue
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">

	<contextName>webapp</contextName>
	<property name="WEBAPP_LOG_BASE" value="${catalina.base}" />

	<appender name="CONSOLE" 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="WEB-APP-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <append>true</append>
		<file>${WEBAPP_LOG_BASE}/logs/webappplatform/web-app.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
  			<fileNamePattern>${WEBAPP_LOG_BASE}/logs/webappplatform/web-app.%i.log.zip</fileNamePattern>
  			<minIndex>1</minIndex>
  			<maxIndex>10</maxIndex>
		</rollingPolicy>
		<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
  			<maxFileSize>100MB</maxFileSize>
		</triggeringPolicy>
		<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>
		<file>${WEBAPP_LOG_BASE}/logs/webappplatform/twc_rest.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
			<fileNamePattern>${WEBAPP_LOG_BASE}/logs/webappplatform/twc_rest.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
			<minIndex>1</minIndex>
			<maxIndex>10</maxIndex>
		</rollingPolicy>
		<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
			<maxFileSize>100MB</maxFileSize>
		</triggeringPolicy>
		<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
			<pattern>%date [%thread] %-5level %logger - %msg%n</pattern>
		</encoder>
	</appender>

	<appender name="ADMIN-CONSOLE-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${WEBAPP_LOG_BASE}/logs/webappplatform/admin-console.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
  			<fileNamePattern>${WEBAPP_LOG_BASE}/logs/webappplatform/admin-console.%i.log.zip</fileNamePattern>
  			<minIndex>1</minIndex>
  			<maxIndex>10</maxIndex>
		</rollingPolicy>
		<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
  			<maxFileSize>100MB</maxFileSize>
		</triggeringPolicy>
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <pattern>%date [%thread] %-5level %logger - %msg%n</pattern>
		</encoder>
  	</appender>

	<appender name="COLLABORATOR-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <append>true</append>
		<file>${WEBAPP_LOG_BASE}/logs/webappplatform/collaborator.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
  			<fileNamePattern>${WEBAPP_LOG_BASE}/logs/webappplatform/collaborator.%i.log.zip</fileNamePattern>
  			<minIndex>1</minIndex>
  			<maxIndex>10</maxIndex>
		</rollingPolicy>
		<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
  			<maxFileSize>100MB</maxFileSize>
		</triggeringPolicy>
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <pattern>%date [%thread] %-5level %logger - %msg%n</pattern>
		</encoder>
  	</appender>

	<appender name="DOCUMENT-EXPORTER-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${WEBAPP_LOG_BASE}/logs/webappplatform/document-exporter.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
			<fileNamePattern>${WEBAPP_LOG_BASE}/logs/webappplatform/document-exporter.%i.log.zip</fileNamePattern>
			<minIndex>1</minIndex>
			<maxIndex>10</maxIndex>
		</rollingPolicy>
		<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
			<maxFileSize>100MB</maxFileSize>
		</triggeringPolicy>
		<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
			<pattern>%date [%thread] %-5level %logger - %msg%n</pattern>
		</encoder>
	</appender>

	<appender name="RESOURCES-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <append>true</append>
		<file>${WEBAPP_LOG_BASE}/logs/webappplatform/resources.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
  			<fileNamePattern>${WEBAPP_LOG_BASE}/logs/webappplatform/resources.%i.log.zip</fileNamePattern>
  			<minIndex>1</minIndex>
  			<maxIndex>10</maxIndex>
		</rollingPolicy>
		<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
  			<maxFileSize>100MB</maxFileSize>
		</triggeringPolicy>
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <pattern>%date [%thread] %-5level %logger - %msg%n</pattern>
		</encoder>
  	</appender>

	<appender name="RESOURCE-USAGE-MAP-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${WEBAPP_LOG_BASE}/logs/webappplatform/resource-usage-map.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
			<fileNamePattern>${WEBAPP_LOG_BASE}/logs/webappplatform/resource-usage-map.%i.log.zip</fileNamePattern>
			<minIndex>1</minIndex>
			<maxIndex>10</maxIndex>
		</rollingPolicy>
		<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
			<maxFileSize>100MB</maxFileSize>
		</triggeringPolicy>
		<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
			<pattern>%date [%thread] %-5level %logger - %msg%n</pattern>
		</encoder>
	</appender>

	<appender name="REPORTS-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${WEBAPP_LOG_BASE}/logs/webappplatform/reports.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
			<fileNamePattern>${WEBAPP_LOG_BASE}/logs/webappplatform/reports.%i.log.zip</fileNamePattern>
			<minIndex>1</minIndex>
			<maxIndex>10</maxIndex>
		</rollingPolicy>
		<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
			<maxFileSize>100MB</maxFileSize>
		</triggeringPolicy>
		<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
			<pattern>%date [%thread] %-5level %logger - %msg%n</pattern>
		</encoder>
	</appender>

	<appender name="SIMULATION-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
		<append>true</append>
		<file>${WEBAPP_LOG_BASE}/logs/webappplatform/simulation.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
			<fileNamePattern>${WEBAPP_LOG_BASE}/logs/webappplatform/simulation.%i.log.zip</fileNamePattern>
			<minIndex>1</minIndex>
			<maxIndex>10</maxIndex>
		</rollingPolicy>
		<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
			<maxFileSize>100MB</maxFileSize>
		</triggeringPolicy>
		<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
			<pattern>%date [%thread] %-5level %logger - %msg%n</pattern>
		</encoder>
	</appender>

	<appender name="AUTHENTICATION-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${WEBAPP_LOG_BASE}/logs/webappplatform/authentication.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
			<fileNamePattern>${WEBAPP_LOG_BASE}/logs/webappplatform/authentication.%i.log.zip</fileNamePattern>
			<minIndex>1</minIndex>
			<maxIndex>10</maxIndex>
		</rollingPolicy>
		<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
			<maxFileSize>100MB</maxFileSize>
		</triggeringPolicy>
		<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
			<pattern>%date [%thread] %-5level %logger - %msg%n</pattern>
		</encoder>
	</appender>

	<root level="WARN">
		<appender-ref ref="CONSOLE"/>
	</root>

	<logger name="com.nomagic.webappplatform" level="INFO" additivity="false">
		<appender-ref ref="WEB-APP-FILE"/>
	</logger>

	<logger name="com.nomagic.authentication" level="INFO" additivity="false">
		<appender-ref ref="WEB-APP-FILE"/>
	</logger>

	<logger name="com.nomagic.webappplatform.adminconsole" level="INFO" additivity="false">
		<appender-ref ref="ADMIN-CONSOLE-FILE"/>
	</logger>

	<logger name="com.nomagic.webappplatform.resourcemanager" level="INFO" additivity="false">
		<appender-ref ref="RESOURCES-FILE"/>
	</logger>

	<logger name="com.nomagic.webappplatform.collaborator" level="INFO" additivity="false">
		<appender-ref ref="COLLABORATOR-FILE"/>
	</logger>

	<logger name="com.nomagic.webappplatform.export" level="INFO" additivity="false">
		<appender-ref ref="DOCUMENT-EXPORTER-FILE"/>
	</logger>

	<logger name="com.nomagic.webappplatform.resourceusagemap" level="INFO" additivity="false">
		<appender-ref ref="RESOURCE-USAGE-MAP-FILE"/>
	</logger>

	<logger name="com.nomagic.webappplatform.reports" level="INFO" additivity="false">
		<appender-ref ref="REPORTS-FILE"/>
	</logger>

    <logger name="com.nomagic.webappplatform.simulation" level="INFO" additivity="false">
        <appender-ref ref="SIMULATION-FILE"/>
    </logger>

	<logger name="com.nomagic.authentication.server" level="INFO" additivity="false">
		<appender-ref ref="AUTHENTICATION-FILE"/>
	</logger>

	<logger name="org.springframework" level="OFF">
		<appender-ref ref="WEB-APP-FILE"/>
	</logger>

	<logger name="TWC_REST_LOGGER" level="OFF">
		<appender-ref ref="TWC_RESPONSE_FILE" />
	</logger>

</configuration>
Tip
titleDescribed 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.

uses the Apache Log4j logging framework. To learn more, see https://logging.apache.org/log4j/2.x/.


To configure the data logging

...

  1. Go to the <install_root>/WebAppPlatform/shared/conf directory and open the log4j2.properties file.
  2. Depending on your needs do one or both of the following:
    • To configure the logging of the Web Application Platform-related information, define the following properties:
      • logger.webappplatform.name
      • logger.webappplatform.level
      • logger.webappplatform.additivity
      • logger.webappplatform.appenderRef.file.ref
    • To change the number and size of logs to be stored, and the log storage time, define the following properties:
      • appender.file.type
      • appender.file.name
      • appender.file.fileName
      • appender.file.filePattern
      • appender.file.layout.type
      • appender.file.layout.pattern
      • appender.file.policies.type
      • appender.file.policies.time.type
      • appender.file.policies.size.type
      • appender.file.policies.size.size
      • appender.file.strategy.type
      • appender.file.strategy.max
  3. Restart the Java application server.


Note
titleStandard logging levels

The Log4J framework has the following standard logging levels: OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE, ALL

...

  • 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.

...

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.

...

Note
titleSpecifying 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".

...

.

How to turn off logging

You can disable data logging to a specific file by changing the logging level of the related logger.

...

To turn off logging

...

  1. Locate the logger the logging of which you want to turn off.
  2. Change the logging level of that logger to "off".

  3. Restart the Java application server.

Note
titleTurning logging back on

To turn on the data logging that has been disabled, change the logging level of the related logger from "off" OFF to the logging level you want to use. Available logging levels are described in step 5 of the above section.