Application Server Logging
work in progress, sorry
- What to log in which environments
- Logging levels
- Logging as object rather than text
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.
printlin can be useful in the REPL the standard out message as well as the evaluation result (
nil) are shown.
printlin can provide additional feeback 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, a Clojure client for Elasticsearch and GitHub repository
- Elasticsearch and Clojure: Getting Started - the practical academic
- Spandex - Elasticsearch new low level rest-client wrapper
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