Application Server Loggingλ︎
- What to log in which environments
- Logging levels
- Logging as object rather than text
- mulog
Simplistic loggingλ︎
println
function sends information to the standard out and so is a very simple mechanism to create logs from specific parts of the application. This should be used sparingly and is no substitute for a specific logging framework.
println
can be useful in the REPL the standard out message as well as the evaluation result (nil
) are shown. println
can provide additional feedback for non-terminating processes that run in the REPL, such as an application server.
Logging to Elastic Search / Kibanaλ︎
Log messages as objects, rather than text strings, provides greater sophistication by search tools as the messages have a structure.
- Elastisch - Clojure client for Elasticsearch and GitHub repository
- Elasticsearch and Clojure: Getting Started - the practical academic
- Spandex - Elasticsearch new low level rest-client wrapper
Problematic Practicesλ︎
Logging to the REPL - sending lots of logs to the REPL makes the REPL much harder to use directly
Logging strings - logs entries are typically objects and far more searchable and discoverable that strings, so send objects to the logging service