How to redirect console logs to a file.

How to redirect console logs to a file.

book

Article ID: KB0093814

calendar_today

Updated On: 01-13-2017

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Resolution:
Do the following to redirect console logs to a file.

1). Open the logback.xml file under the <TIBCO_HOME>\bw\6.2\config\design\logback folder.

2). Add the following appender (FILE) in the top APPENDER section, which writes to file:

  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <pattern>%d{HH:mm:ss.SSS} %-5level [%thread] %logger{36} - %msg%n</pattern>
    </encoder>
  </appender>
  <appender name="FILE" class="ch.qos.logback.core.FileAppender">
      <file>c:/temp/studio.log</file>
      <encoder>
        <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
      </encoder>
  </appender>

3). Goto the bottom of the file and add another appender reference:

<appender-ref ref="FILE" />
It should look like:
 <root level="DEBUG">
     <appender-ref ref="STDOUT" />
     <appender-ref ref="FILE" />
  </root>

4). Check the file "c:/temp/studio.log" for the complete list of errors.

Issue/Introduction

How to redirect console logs to a file.