Redirecting jetty warnings to another log file

Redirecting jetty warnings to another log file

book

Article ID: KB0081206

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks 6.x

Description

How to redirect jetty warnings to another log file?

Environment

all

Resolution

Create a new appender to just handle the jetty warn and error logs and this appender can have limited number of files and sizes.  Open logback.xml from the appnode folder and add this new appender:

<appender name="NEW-APPENDER-FOR-JETTY" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>../log/jetty_ERR_WARN.log</file>
    <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
        <fileNamePattern>../log/jetty_ERR_WARN_%i.log</fileNamePattern>
        <minIndex>1</minIndex>
        <maxIndex>20</maxIndex>
    </rollingPolicy>
    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
        <maxFileSize>300MB</maxFileSize>
    </triggeringPolicy>
    <encoder>
        <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{36} - %msg%n</pattern>
    </encoder>
</appender>

<logger name="org.eclipse.jetty" additivity="false"> ?<!--additivity makes sure its using only this appender and not other parent appenders-->?
    <level value="WARN" />  <!-- Will include warn and error logs -->
    <appender-ref ref="NEW-APPENDER-FOR-JETTY"/>   
</logger> 

You will see two log files during execution of the BW applications - one for appnode and one for jetty warning.
A sample logback.xml is attached for your reference.

Issue/Introduction

Redirecting jetty warnings to another log file

Attachments

Redirecting jetty warnings to another log file get_app