How to logging output in console to file?

前端 未结 1 1425
一整个雨季
一整个雨季 2021-01-28 14:37

The NetBeans generate code like Logger.getLogger(svr.class.getName()).log(Level.SEVERE, null, ex); to output exception in catch.It will display in console. After I

相关标签:
1条回答
  • 2021-01-28 15:12

    The logging system in NetBeans is based on the standard JDK's java.util.logging and complies to it as much as possible. In order to output error messages to a file, you can provide your own logging properties file on the classpath of your project.

    See the following links for more info :

    • Netbeans logging : http://bits.netbeans.org/dev/javadoc/org-openide-util/org/openide/util/doc-files/logging.html

    • Java Util logging with logging properties file sample : http://www.javapractices.com/topic/TopicAction.do?Id=143

    0 讨论(0)
提交回复
热议问题