Logging in SQL-DK uses standard Java logging subsystem and thus is fully configurable. This page describes only default behaviour preconfigured in SQL-DK.
level | description |
SEVERE | fatal errors |
WARNING | SQL warnings from database and other warnings |
INFO | informational messages |
CONFIG | |
FINE | verbose messages and stack traces |
FINER | debug information |
FINEST | tracing (not used) |
ALL | pseudolevel, everything |
Default level is INFO
.
Other levels can be specified on command line by setting environmental property:
$ LOG_LEVEL=FINE sql-dk --db …
Or configured persistently:
$ echo '[ -n "$LOG_LEVEL" ] || LOG_LEVEL=FINE' >> ~/.sql-dk/environment.sh
Log messages are printed in brief and colorful form to the STDERR. They should never mess STDOUT which is dedicated for data (output from Formatter).
By default, the logging subsystem is configured by class
info.globalcode.sql.dk.logging.LoggerInitializer
and log messages are formatted by
info.globalcode.sql.dk.logging.ColorfulConsoleFormatter
.
This standard behaviour can be changed by setting different
-Djava.util.logging.config.class=…
or
-Djava.util.logging.config.file=…
Java options.
SQL-DK, free software © 2013-2020 GlobalCode