Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

LogBack can be configured to change the log appender and format of log messages for the runtime and application channels. By default, Fabric3 sends log messages to the console. Production systems should use a form of persistent logging such as the LogBack RollingFileAppender (for documentation on available appenders, see LogBack Appenders). Custom appenders are added under the <application.monitor> and <runtime.monitor> elements in systemConfig.xml as shown below:

Code Block
xml
xml
<application.monitor>
    <configuration>
     <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>fabric3.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
           <fileNamePattern>test.%i.log.zip</fileNamePattern>
           <minIndex>1</minIndex>
           <maxIndex>3</maxIndex>
        </rollingPolicy>

        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
           <maxFileSize>5MB</maxFileSize>
        </triggeringPolicy>
        <encoder>
            <pattern>[%thread] %-5level %logger{35} - %msg%n</pattern>
        </encoder>
     </appender>     
  </configuration>
</application.monitor>

...