0% found this document useful (0 votes)
14 views1 page

Logback XML Configuration Example

This document configures logging for a cloud application. It defines an ISO date format property, a conversion rule for one-line exceptions, and a file appender that rolls logs daily and keeps 5 days of history. The root logger and a specific logger are configured to write debug logs to this file appender. Several other loggers are configured with different levels.

Uploaded by

AF
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views1 page

Logback XML Configuration Example

This document configures logging for a cloud application. It defines an ISO date format property, a conversion rule for one-line exceptions, and a file appender that rolls logs daily and keeps 5 days of history. The root logger and a specific logger are configured to write debug logs to this file appender. Several other loggers are configured with different levels.

Uploaded by

AF
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

<configuration scan="true">

<property name="isoDate" value="%date{&quot;yyyy-MM-


dd'T'HH:mm:[Link]'Z'&quot;,GMT}" />
<conversionRule conversionWord="oneLineEx"
converterClass="[Link]" />

<appender name="FILE" class="[Link]">


<file>/var/log/cloud/[Link]</file>
<rollingPolicy
class="[Link]">
<!-- daily rollover -->
<fileNamePattern>/var/log/cloud/cloud-test.%d{yyyy-MM-
dd}.[Link]</fileNamePattern>
<!-- keep 5 days' worth of history -->
<maxHistory>5</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${isoDate} %-5level [%X{user}][%X{method}] [%.-35thread]
%logger{55} - %msg %oneLineEx%n</pattern>
</encoder>
</appender>

<root level="debug">
<appender-ref ref="FILE" />
</root>
<logger name="[Link]" level="debug"/>

<logger name="[Link]" level="info"/>


<logger name="[Link]" level="info"/>
<logger name="[Link]" level="info"/>
<logger name="jdbc" level="off"/>
<logger name="[Link]" level="all"/>
<logger name="[Link]"
level="off"/>
<logger name="[Link]" level="off"/>

</configuration>

You might also like