The logs used to be divided by date, but now they are all in the same file.

the logs generated on my side used to be distinguished by days, but I don"t know from that day on, the logs are not divided according to days, and they are all in the same file. What is the reason? have you ever encountered this kind of situation?

Log configuration file is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
    <appender name="rootFileApp" class="org.apache.log4j.DailyRollingFileAppender">
        <param name="File" value="logs/bts_teller.log"/>
        <param name="Append" value="true"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %c [%t] %-5p %x - %m%n"/>
        </layout>
    </appender>
    <appender name="rootConsole" class="org.apache.log4j.ConsoleAppender">
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %c [%t] %-5p %x - %m%n"/>
        </layout>
    </appender>
    <root>
        <priority value="info"/>
        <appender-ref ref="rootFileApp"/>
        <!--<appender-ref ref="rootConsole"/>-->
    </root>
</log4j:configuration>

many other modules also use this configuration file, and there has been no problem. I don"t know why I have this problem.

Mar.25,2021

if you confirm that the code has not been touched, make sure that the environment is abnormal, such as the permission to create a file.

Menu