Modify the log4j files

You can set up the rotation of several log files based on the file size by editing the files listed under Log4j files.

Configure Log rotation to a file per file-size

In this example, the configuration file is the TM log: <FILEDRIVEHOME>/conf/tm-log4j.xml. The example uses FILEDRIVEHOME instead of <FILEDRIVEHOME> to represent the SecureTransport installation directory to avoid confusion with the syntactic use of pointed brackets in XML.


<DailyRollingFileAppender name="ServerLog" fileName="FILEDRIVEHOME/var/logs/tm.log" append="true" rotateDirectory="FILEDRIVEHOME/var/db/hist/logs/" datePattern="'.'yyyy-MM-dd">

  <PatternLayout pattern="%d{ISO8601} [%t] %p %c %equals{%x}{[]}{} - %m%n%ex"/>



<RollingFile name="ServerLog" fileName="FILEDRIVEHOME/var/logs/tm.log" append="true" filePattern="FILEDRIVEHOME/var/db/hist/logs/%d{yyyy-MM-dd}.tm.log">

  <PatternLayout pattern="%d{ISO8601} [%t] %p %c %equals{%x}{[]}{} - %m%n%ex"/>

  <DefaultRolloverStrategy max="5">

    <Delete basePath="FILEDRIVEHOME/var/db/hist/logs/" maxDepth="2">

      <IfFileName glob="*.tm.log" />

      <IfLastModified age="5d" />




    <TimeBasedTriggeringPolicy />




You can use any of the log4j file appenders.

Note For another way to manage log file rotation, see Log Entry Maintenance application.

Attach logger to a non-blocking asynchronous appender

In some cases when the log messages are directed to a flat file, the rotation of the file might take a considerable amount of time during which certain SecureTransport processes (including user log-in) are unavailable. This might happen, for example, when rotating a large log to a file which is hosted on a remote location.

In this case, you might consider attaching the rotating log to an asynchronous appender which is explicitly defined as not-blocking. To achieve this, use the following example:

<Async name="ServerLog" bufferSize="20000" blocking="false" includeLocation="false">

  <AppenderRef ref="DailyAppender"/>


<DailyRollingFileAppender name="DailyAppender" fileName="FILEDRIVEHOME/var/logs/tm.log" append="true" rotateDirectory="FILEDRIVEHOME/var/db/hist/logs/" datePattern="'.'yyyy-MM-dd">

  <PatternLayout pattern="%d{ISO8601} [%t] %p %c %equals{%x}{[]}{} - %m%n%ex"/>


Note It is recommended to set the buffer size according to the size of your log. In case the limit is reached during rotation, the logger might stop.

Configure Filters

You can use the log4j2 filters to specify if or how a log event should be published. A filter can be configured for the entire configuration or at logger or appender level. For more information, see Apache Log4j 2 documentation.

The example below shows how to filter out unwanted plugin messages that contain the string DONOTSHOWME. In it, we add a RegexFilter filter in the Logger element in <FILEDRIVEHOME>/conf/admin-log4j.xml file.

<Logger name="" level="INFO" additivity="false">

  <AppenderRef ref="ServerLog"/>


    <RegexFilter regex=".DONOTSHOWME." onMatch="DENY" onMismatch="ACCEPT"/>


  <!-<AppenderRef ref="Stdout" />->

  <!-<AppenderRef ref="Stderr" />->


Related topics:

Related Links