0

I am using Java Logging (not Log4j). I want to send logs of level INFO and below it to System.out, and WARNING and SEVERE to System.err. I believe it looks much nicer, because I can easily distinguish error from info and below it. Is there anyway to do that?

In general, it is possible to tell Logger to log message below a certain level. Bu default it goes higher than the specified level.

Thanks a lot

1

1 Answer 1

1

I believe it looks much nicer, because I can easily distinguish error from info and below it. Is there anyway to do that?

As 'pruntlar' pointed out that is covered in: How do I change java logging console output from std err to std out?

In general, it is possible to tell Logger to log message below a certain level. By default it goes higher than the specified level.

Not out of the box. You have to write a Level filter and install it on the Logger or Handler.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.