Logging

As logging framework, Geomajas uses the SLF4J library. All logging should therefore be done through SLF4J. A logger is created using:

private final Logger log = LoggerFactory.getLogger(ClassName.class);

When inserting debug statements, parameterized messages should be used to prevent the need/usefulness of isDebugEnabled.

When to use a specific logging level:

Log level Default on Use
ERROR  Yes  major problems, should always be visible in logs and are likely to require action from a person (to fix the condition
or assure it does not happen again). Indicates that something is seriously wrong.
WARN  Yes warning about potential problems. Should always be visible in logs and a person will probably need to assess
whether this is harmless or should be treated as an error.
INFO  Yes  important information. You can assume this level is on in production, so it should be carefully considered whether
this level is appropriate. In general only used to indicate service status (started, stopped).
DEBUG  No  logging information which is detailed enough to know what is happening in the system, without flooding the logs.
TRACE  No  very detailed logging, probably only making sense to the developer of the code.