Skip to content

Logging

Arne Bertrand edited this page Feb 12, 2020 · 1 revision

Logging

For logging we are using the builtin Java.util.logging package. Every class should get it's own logger, in the following way:

class MyClass {
private static Logger logger = Logger.getLogger(MyClass.class.getName());
//...
}

HELP! My messages aren't being printed to the console!

We've had this issue enough times now to write it down... Before panicking, check the following things:

  • which run config am I running?
  • in the corresponding config.yml (e.g. devConfig.yml), what is the logging level?
  • in the corresponding config.yml, what is the threshold for the console appender?

Both of these last two points have to be set to at least the level you are logging at. e.g. if you are using logger.info(myMessage) both the level and the treshold have to be at INFO or "lower"

Since "higher" and "lower" don't really make sense here, let's define what we mean:

OFF > ERROR > WARN > INFO > DEBUG > TRACE > ALL

If these are all OK and your messages are still not being printed, you can finally start panicking.

Clone this wiki locally