Playing back a log file while running Java

So, I'm currently running a Java application that will work for several days. He records a lot. Unfortunately, I accidentally deleted the log file, so now the log is no longer written. Is there a way to restart logging on the fly without restarting a real Java program? I tried to recreate the file with the same name, but it does not write. Any ideas? I am using java.util.logging .

+5
source share
1 answer

If you can load the java class in your application on the fly, try using the following LogManager.reset () or LogManager.readConfiguration () method.

0
source

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


All Articles