How do I change java logging console output from std err to std out?

后端 未结 13 1617
旧巷少年郎
旧巷少年郎 2020-11-27 06:50

I\'m using the standard ConsoleHandler from java.util.logging and by default the console output is directed to the error stream (i.e. System.

13条回答
  •  忘掉有多难
    2020-11-27 07:25

    Have a look at the docs and source for ConsoleHandler - I'm sure you could easily write a version which just uses System.err instead of System.out. (It's a shame that ConsoleHandler doesn't allow this to be configured, to be honest.)

    Then it's just a case of configuring the logging system to use your new StdoutHandler (or whatever you call it) in the normal way.

提交回复
热议问题