Parallel bwadmin run creates TMP log files

Parallel bwadmin run creates TMP log files

book

Article ID: KB0137460

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks 6.8.1

Description

We have below workaround to avoid .tmp file creation under logs folder which is as below.
As this issue was related to bwadmin so we suggested to modify bwadmin-logback file(Configuration file) and the suggested configuration change in logback file is

<fileNamePattern>${BW_LOG_DIR}/bwadmin.log.%d{yyyy-MM-dd HH:mm:ss.SSS}.%i.log</fileNamePattern>

So after this change, the configuration will look like

=========================================================

<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="1 minutes">

<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${BW_LOG_DIR}/bwadmin.log</file>
<append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- rollover daily -->
<fileNamePattern>${BW_LOG_DIR}/bwadmin.log.%d{yyyy-MM-dd HH:mm:ss.SSS}.%i.log</fileNamePattern>

<!-- each file should be at most 100MB, keep 60 days' worth of history, but at most 1GB -->
<maxFileSize>100MB</maxFileSize>
<maxHistory>60</maxHistory>
<totalSizeCap>1GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
<withJansi>true</withJansi>
<encoder>
<pattern>%d{HH:mm:ss.SSS} %-5level [%thread] %logger{36} - %msg%n</pattern>
</encoder>
</appender>


<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>

<logger name="org.glassfish.jersey.client.ClientRequest" additivity="false">
<appender-ref ref="FILE"/>
</logger>

<root level="INFO">
<appender-ref ref="STDOUT"/>
<appender-ref ref="FILE"/>
</root>

</configuration>
=========================================================


So, using this configuration change, when a rollover happens for a log file, it will create another log file instead of a .zip file, which will not create any .tmp files anymore.

And in our older behaviour, the flow is like

bwadmin.log->xyz.tmp->bwadmin123.zip

And its configuration is like this

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">

  <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>${BW_LOG_DIR}/bwadmin.log</file>
    <append>true</append>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <fileNamePattern>${BW_LOG_DIR}/bwadmin.log.%d{yyyy-MM-dd}.log.zip</fileNamePattern>
    </rollingPolicy>
    <encoder>
      <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] <%X{operationID}> %logger{36} - %msg%n</pattern>
    </encoder>
  </appender>

  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
      <level>WARN</level>
    </filter>
    <withJansi>true</withJansi>
    <encoder>
      <pattern>%d{HH:mm:ss.SSS} %-5level [%thread] <%X{operationID}> %logger{36} - %msg%n</pattern>
    </encoder>
  </appender>

  <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
    <resetJUL>true</resetJUL>
  </contextListener>
 
  <logger name="org.glassfish.jersey.client.ClientRequest" additivity="false">
    <appender-ref ref="FILE" />
  </logger>
  
  <logger name="org.eclipse.jetty.server.HttpChannel">
  </logger>
  
  <!-- ============================================================= -->
  <!-- *  SQL Driver Logger                                          * -->
  <!-- ============================================================= --> 
  
  <logger name="com.microsoft.sqlserver" level="WARN" additivity="false">
    <appender-ref ref="STDOUT" />
    <appender-ref ref="FILE" />
  </logger>
  
  <!-- ============================================================= -->
  <!-- *  Jetty and Jersey Logger                                    * -->
  <!-- ============================================================= -->  
  
  <logger name="org.eclipse.jetty" level="WARN" additivity="false">
    <appender-ref ref="STDOUT" />
    <appender-ref ref="FILE" />
  </logger>
  
  <logger name="org.glassfish.jersey" level="WARN" additivity="false">
    <appender-ref ref="STDOUT" />
    <appender-ref ref="FILE" />
  </logger>
  
  <!-- ============================================================= -->
  <!-- *  Root Level Logger                                          * -->
  <!-- ============================================================= -->  
 
  <root level="INFO">
    <appender-ref ref="STDOUT" />
    <appender-ref ref="FILE" />
  </root>

</configuration>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Issue/Introduction

Parallel bwadmin run creates TMP log files