Quartz continues to write its log to all my log files

I have a problem. Quartz continues to put its journal in all of my log files. Can I redirect Quart log to a separate file? Here is mine logback.xml:

<configuration debug="false">
  <appender name="hcmut.cse.virtuallab.request" class="ch.qos.logback.core.FileAppender">
    <file>log/hcmut.cse.virtuallab.request.log</file>
    <encoder>
      <pattern>%date %level [%thread] %logger [%file:%line] %msg%n</pattern>
    </encoder>
  </appender>
  <appender name="hcmut.cse.virtuallab.timer" class="ch.qos.logback.core.FileAppender">
    <file>log/hcmut.cse.virtuallab.timer.log</file>
    <encoder>
      <pattern>%date %level [%thread] %logger [%file:%line] %msg%n</pattern>
    </encoder>
  </appender>
  <logger name="root" level="debug">
    <appender-ref ref="hcmut.cse.virtuallab.timer" />
    <appender-ref ref="hcmut.cse.virtuallab.request" />
  </logger>
</configuration>
+2
source share
2 answers

Add this line to the log configuration file:

<logger name="org.quartz">
  <level value="info" />
</logger>
+6
source

Actually, if you want to write Quartz to a separate log file, then create an application and link it to the Quartz namespace

<appender name="QuartzRLFA" type="log4net.Appender.RollingFileAppender">
  <file value="Logs/QuartzOnly.log"/>
  <appendToFile value="true"/>
  <maxSizeRollBackups value="5"/>
  <maximumFileSize value="5MB"/>
  <rollingStyle value="Size"/>
  <staticLogFileName value="true"/>
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%date [%15.15thread] %-5level %logger{2} - %message%newline%exception"/>
  </layout>
</appender>
<!-- Setup the root category, add the appenders and set the default level -->
<root>
  <level value="DEBUG"/>
  <appender-ref ref="hcmut.cse.virtuallab.request"/>
</root>
<!-- Specify the level specific to Quartz -->
<logger name="Quartz">
    <level value="ALL" />
    <appender-ref ref="QuartzRLFA" />
</logger>
+5
source

Source: https://habr.com/ru/post/1016676/


All Articles