How to register console output to a file?

NetBeans generates code like Logger.getLogger(svr.class.getName()).log(Level.SEVERE, null, ex); to throw an exception in catch.It will be displayed in the console. After deploying my project, I see no exception information. How to output these error messages to a file and to the console when the console is available?

Thanks guys.

0
source share
1 answer

NetBeans' logging system is based on the standard jdk java.util.logging and matches it as much as possible. To output error messages to a file, you can provide your own logging properties file in the classpath of your project.

For more information, see the following links:

+3
source

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


All Articles