KB-1120 How to create custom log files in Appian
Purpose
This article outlines the process to create a custom log file in Appian. The custom file can have logs from specific Java classes which may or may not be included in the application server logs. This will help if troubleshooting a specific issue or logs containing sensitive data are required.
Instructions
To enable logging for the custom log:
- Open the appian_log4j.properties file. For Appian 18.3 and later, this file can be found in
<APPIAN_HOME>/deployment/web.war/WEB-INF/resources. For Appian 18.2 and earlier, this file can be found in<APPIAN_HOME>/ear/suite.ear/resources. - Add the following lines to the end of the file:
Note: In order to include the above logs in the default application server logs, change the value of########### Custom Appenders log4j.logger.<JAVA_CLASS_NAME>=DEBUG, CUSTOM_LOGGING log4j.additivity.<JAVA_CLASS_NAME>=false
###### Custom Logging file appender log4j.appender.CUSTOM_LOGGING=org.apache.log4j.RollingFileAppender log4j.appender.CUSTOM_LOGGING.layout=org.apache.log4j.PatternLayout log4j.appender.CUSTOM_LOGGING.layout.ConversionPattern=%d [%t] %-5p %c - %m%n log4j.appender.CUSTOM_LOGGING.File=${AE_LOGS}/.log log4j.appender.CUSTOM_LOGGING.MaxFileSize=10MB log4j.appender.CUSTOM_LOGGING.MaxBackupIndex=1000 log4j.appender.CUSTOM_LOGGING.encoding=UTF-8log4j.additivity.<JAVA_CLASS_NAME>to true. - Save the changes and wait for 2-3 minutes for them to be picked up by the application server.
To disable logging for the custom log:
- Return to the appian_log4j.properties file, and update the lines modified so that the value of
log4j.logger.<JAVA_CLASS_NAME>is changed to toOFF, CUSTOM_LOGGING. - Save the file and check the custom log to verify that entries are no longer being recorded.
Note: Do not completely remove the lines in order to disable the logging.
Affected Versions
This article applies to all versions of Appian.
Last Reviewed: June 2021
