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

Config Logger Spring (Logback-Spring - XML)

This document is a configuration file for logging in a Java application using Logback. It specifies the log file path, console output format, and a rolling file appender that archives logs daily or when they exceed 100MB. The root logger is set to 'info' level and references both the console and rolling file appenders.
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)
28 views1 page

Config Logger Spring (Logback-Spring - XML)

This document is a configuration file for logging in a Java application using Logback. It specifies the log file path, console output format, and a rolling file appender that archives logs daily or when they exceed 100MB. The root logger is set to 'info' level and references both the console and rolling file appenders.
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

<?xml version="1.0" encoding="UTF-8"?

>

<configuration> # Path write log


<property name="LOGS" value="D:\Desktop\log"/>

# Declare config to export console


<appender name="Console" class="[Link]">
<layout class="[Link]">
<Pattern>
%d{yyyy-MM-dd HH:mm} %-5level ${PID:-} %logger{40} : %msg %n
</Pattern>
</layout>
</appender>

<appender name="RollingFile"
class="[Link]">
<file>${LOGS}/[Link]</file>
<encoder
class="[Link]">
<Pattern>%d{yyyy-MM-dd HH:mm} %-5level ${PID:-} %logger{40} : %msg
%n</Pattern>
</encoder>

<rollingPolicy class="[Link]">
<!-- rollover daily and when the file reaches 10 MegaBytes -->
<fileNamePattern>${LOGS}/archived/spring-boot-logger-%d{yyyy-MM-dd}.
%[Link]
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class="[Link]">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
</appender>

<root level="info">
<appender-ref ref="Console" />
<appender-ref ref="RollingFile" />
</root>
</configuration>

You might also like