Is there a way to specify a storage path to use logback?

Asked 1 years ago, Updated 1 years ago, 81 views

I use logback or log pojay.

I want to specify a separate path to save the log txt file.

Is there a way to specify a storage path?

java logback log4j

2022-09-21 23:00

1 Answers

Please read the document carefully

It can be explicitly specified in the file element as shown below.

<appender name="FILE" class="ch.qos.logback.core.FileAppender">
    <file>/home/allinux/myApp.log</file>
    <encoder>
      <pattern>File Pattern</pattern>
    </encoder>
  </appender>


2022-09-21 23:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.