1

I have a java project with this logback. when i running on eclips its normaly create log file but when i export to jar and running jar file it doesn't create log file.

<configuration>
        <statusListener class="ch.qos.logback.core.status.NopStatusListener" />
        <timestamp key="bySecond" datePattern="yyyy-MM-dd_HH:mm:ss"/>
        <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
            <layout class="ch.qos.logback.classic.PatternLayout">
                <pattern>%d{yyyy-MM-dd HH:mm:ss} %-5level [%file:%line] %msg%n</pattern>
            </layout>
        </appender>
        <appender name="FILE" class="ch.qos.logback.core.FileAppender">
            <file>/var/log/Server-Log/Server-${bySecond}.log</file>
            <append>true</append>
            <encoder>
                <pattern>%d{yyyy-MM-dd HH:mm:ss} %-5level [%file:%line] %msg%n</pattern>
            </encoder>
        </appender>
        <root level="info" additivity="false">
            <appender-ref ref="STDOUT"/>
            <appender-ref ref="FILE"></appender-ref>
        </root>
    </configuration>
  • Welcome to Stack Overflow. Please read about [asking questions](https://stackoverflow.com/help/asking). Images of code are not searchable, can not be copied by someone working on the problem, and are not accessible. Please [edit] the question to replace or augment the image with the text that it contains. – Jason Aller Oct 17 '19 at 16:09
  • Please check if your classpath contains `logback-classic` jar. – Ramu Nov 09 '19 at 19:12

0 Answers0