Book Image

Clojure Web Development Essentials

By : Ryan Baldwin
Book Image

Clojure Web Development Essentials

By: Ryan Baldwin

Overview of this book

Table of Contents (19 chapters)
Clojure Web Development Essentials
About the Author
About the Reviewers

Adding an appender

Luminus generates our application to use the rotor appender. I prefer using a rolling appender instead of a rotor appender. A rolling appender is a file appender, like the rotor appender, however, it doesn't create a new log file when a predetermined maximum size is hit. Instead, a new log file is created either daily, weekly, or monthly. I find rolling appenders more useful in production environments because they help when diagnosing problems that have happened sometime in the past (you have a better idea which log files to check).

In this section, we're going to configure a rolling appender for our hipstr application.

Adding the rolling appender

We can put our rolling logs in their own directory, called logs. Unfortunately, Timbre doesn't create directories for us, so we'll have to create the directory first. From the terminal, add a logs directory in the hipstr source root:

# mkdir logs

Next, in our hipstr.handler namespace, we'll want to refer to the taoensso.timbre.appenders...