Skip to content
Advertisement

relations between log levels and stdErr/stdOut

i read many informations on the net but i’d like to summarize, and still no understand how it works. I’d like to know the relation betwenn log levels and stdOut vs stdErr in java ?

what about these kinds of logs ?

  logger.trace(..
  logger.warn(..
  logger.error(..

what do these logs go ?

i absolutly don’t see relation between java logs and stdOut/stdErr.

Thanks by advance.

Advertisement

Answer

Very briefly:

Loggers are part of a high level logging framework. Logging is much more advanced than standard output streams.

When a process starts up the operating system gives it a stdout and stderr stream which the program may write to. Stdout should be used for information and stderr for error information.

This is much lower level and you can access these streams with the System class:

System.out.println(); // Write to stdout
System.err.println(); // Write to stderr
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement