KB-1409 How to move the application server log to the main logs folder

With the latest changes to 17.1, the application server log will no longer be written to the application-server.log file in the <APPIAN_HOME>/logs file path. Instead the output has been combined with the application server’s standard output file which is found in <JBOSS_HOME>/logs/server.log.<date>. In order to promote consistency with the other log files, this guide explains how to the move the JBoss application stdOut logs into the <APPIAN_HOME>/logs directory.

Note: The instructions below are setup for JBoss. If using WebLogic, additional configurations will need to be made to capture stdout in a log file.

Steps

1) Open standalone.xml

In your configuration repository, locate the standalone.xml<ENVIRONMENT> file corresponding to your environment.

  • File Path: <REPO_HOME>/bin/jboss/jboss-eap-6.4/standalone/configuration/

2) Update standalone.xml

Locate the <periodic-rotating-file-handler> element within the subsystem xmlns="urn:jboss:domain:logging:1.5" section. Update the file path by updating the file element to reflect the following value:

<file path="${appian.home.ear}/../logs/application-server-jboss.log"/>

This configuration will create a new stdOut log file on a daily basis targeted to the established file path.

Notice that the log name in the file path was also changed from server.log to application-server-jboss.log. This allows Appian’s cleanup.bat|sh scripts to recognize these files as the application server log during its cleanup activities. The logs.xml file is searching for this file by application-server*, so leaving the name as server.log would not suffice. More information about the cleanup script is found in the documentation.

After the standalone.xml change is made, it should look something like this:


a) Max File Size Configuration

The file size of the application server log can get very large if left to recreate on a daily basis. An alternative approach is to cap the log at a certain file size. After this file size is exceeded, a new log file will be created. To implement this configuration, replace the <periodic-rotating-file-handler> element with the following:

<size-rotating-file-handler name="FILE" autoflush="true">
 <formatter>
    <pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
 </formatter>
 <file path="${appian.home.ear}/../logs/application-server-jboss.log"/>
 <rotate-size value="10m"/>
 <max-backup-index value="50"/>
 <append value="true"/>
</size-rotating-file-handler>

This configuration will create a new stdOut log file after the file grows to 10 MB in size.

Afterwards it should look something like this:

3) Deploy Changes

Deploy the configurations from your repository to your target JBoss instance.

4) Verify Output

Upon starting up Appian, verify that the JBoss stdOut log is being properly written to in your specified target path.

Related
Recommended