Log4j FileAppender recreating deleted files

后端 未结 5 1729
悲哀的现实
悲哀的现实 2021-01-03 07:08

I am using Log4j as logging framework in a project I am working on. I have the following situation: Log4j is configured to write the logs into a log file. At some point, thi

5条回答
  •  孤城傲影
    2021-01-03 07:20

    Make sure you can declare this line in your log4j file

        log4j.appender.rollingFile.File=D:/myapp/mylog.log
    

    If you already declared it, you log file can delete or replace as you like. Then you rerun your program and new log file is created in this path.

提交回复
热议问题