Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logfile midnight error #713

Open
125461471 opened this issue Oct 12, 2023 · 0 comments
Open

logfile midnight error #713

125461471 opened this issue Oct 12, 2023 · 0 comments

Comments

@125461471
Copy link

I have started the same JAR file on the same server using two different ports, and I'm writing logs to the same log file. The log file should be split by day and when it reaches 30MB, a new log file should be created. However, I'm facing the following issue: after midnight, one of the services is still writing logs to the file from the previous day and not creating a new one, while the other service is working correctly. What could be the reason for this?

lQLPJxXl-T6EVczNAYPNA9iwtquJMuI65psFGlEibtN3AA_984_387

`

<springProperty scope="context" name="logfile.home" source="server.logfile.home"/>
<springProperty scope="context" name="logLevel" source="server.loglevel"/>
<springProperty scope="context" name="profiles.active" source="spring.profiles.active"/>



<appender name="ERRORFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>${logfile.home}/error/error.log</file>
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
        <level>WARN</level>
    </filter>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
        <FileNamePattern>${logfile.home}/error/error.%d{yyyy-MM-dd}-%i.log</FileNamePattern>
        <MaxHistory>60</MaxHistory>
        <totalSizeCap>2GB</totalSizeCap>
        <TimeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
            <MaxFileSize>30MB</MaxFileSize>
        </TimeBasedFileNamingAndTriggeringPolicy>
    </rollingPolicy>
    <encoder>
        <pattern>[%d{yyyy-MM-dd HH:mm:ss}] [%p] [%t] [%class{35}] [%X{supplierId}-%X{userId}][%X{deviceSn}][%X{traceId}] [%m]%n</pattern>
        <charset>UTF-8</charset>
    </encoder>
</appender>

<appender name="DEBUGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>${logfile.home}/debug/debug.log</file>
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
        <level>DEBUG</level>
    </filter>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
        <FileNamePattern>${logfile.home}/debug/debug.%d{yyyy-MM-dd}-%i.log</FileNamePattern>
        <MaxHistory>1095</MaxHistory>
        <totalSizeCap>30GB</totalSizeCap>
        <TimeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
            <MaxFileSize>30MB</MaxFileSize>
        </TimeBasedFileNamingAndTriggeringPolicy>
    </rollingPolicy>
    <encoder>
        <pattern>[%d{yyyy-MM-dd HH:mm:ss}] [%p] [%t] [%class{35}] [%X{supplierId}-%X{userId}][%X{deviceSn}][%X{traceId}] [%m]%n</pattern>
        <charset>UTF-8</charset>
    </encoder>
</appender>
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
    <neverBlock>true</neverBlock>
    <queueSize>512</queueSize>
    <appender-ref ref="DEBUGFILE" />
</appender>

<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE"/>
<logger name="org.hibernate.type.descriptor.sql.BasicExtractor" level="DEBUG"/>
<logger name="org.hibernate.engine.QueryParameters" level="DEBUG"/>
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG"/>

<root level="${logLevel}">
    <appender-ref ref="DEBUGFILE"/>
    <appender-ref ref="ERRORFILE"/>
</root>

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant