Details
-
Improvement
-
Resolution: Duplicate
-
Major
-
None
-
None
-
None
Description
Dear dev,
I tried one of the solutions here .periodictimebasedfilenamingandtrigerringpolicy but its not working. I tried to include it in my system which the requirements requires me to create new log file every 5 minutes. Please help me with my university project. thank you.
xml :
<?xml version="1.0" encoding="UTF-8" ?>
<configuration scan="true" scanPeriod="60 seconds">
<appender name="my_appender" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>F:/Logs/Server.log</File>
<encoder>
<Pattern>Server[%d
][%p] - %m%n</Pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>F:/Logs/Server-%d
.log</FileNamePattern>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.PeriodicTimeBasedFileNamingAndTriggeringPolicy">
<period>600</period>
</triggeringPolicy>
</appender>
<logger name="com.mypackage.application" level="debug" additivity="false">
<appender-ref ref="my_appender" />
</logger>
</configuration>
Attachments
Issue Links
- duplicates
-
LOGBACK-554 improve RollingCalendar and TimeBasedFileNamingAndTriggeringPolicyBase to enable periodic loggic
- Open