January 2014
Intermediate to advanced
232 pages
5h 11m
English
Most real-world applications require some sort of logging functionality. At the very least we want to log any errors that happen in our application. This will allow us to go back and trace the cause of the errors if they happen in production.
Several logging options are available. In this section we’ll use the Timbre library.[51] First, we’ll need to include it in our project file:
| picture-gallery-logging/project.clj | |
| | [com.taoensso/timbre "3.1.6"] |
Then we can start using it by requiring it in our namespace and calling the trace debug, info, warn, error, and fatal functions. Let’s add logging to the upload namespace and log errors if an exception occurs when we try to delete a file.
| | (ns picture-gallery.routes.upload |
| | (:require ... |
Read now
Unlock full access