I looked at the api about the logger class ( here ) and I looked at the Logger.info method. I was confused when I saw the perimeter as a message displayed as a string public void info(String msg) , which is the same as System.out.println() . I am wondering what sets these two apart, and why we use Logger instead of System.out.println when they can print the same thing.
In Logger.
Logger.info("Hello")
Exit:
[INFO ] 2015-08-07 11:18:46.140 [main] ClassName Hello
In System.out.println
`System.out.println (" Hello ")
Conclusion: Hello
java logging
Redocket
source share