0

I am currently using Logger from Java.Util, The default behavior for logger.info is like the following

Mar 22, 2011 6:52:04 AM com.mycompany.app.App main
INFO: Test API Logger

The font is in red.

How to make the logger to output in just one line with black colored font?

4

3 回答 3

2

Read the package documentation for java.util.logging. It will tell you how to create a configuration file. As per the comment, the red has nothing to do with java, it's something else messing with the output.

Or, you might prefer log4j if you want to do serious format tuning.

于 2011-03-21T23:13:43.527 回答
1

There's no colour configuration in the java logging framework at all. That's the IDE display choice (to show error in red, when logged using System.err or logger.error()).

于 2011-03-21T23:19:12.263 回答
1

Better go for log4J framework.

于 2011-03-22T00:28:10.577 回答