A Clojure library designed to help with your log lines. Currently creates a log entry structure for Nginx logs, and allows for some basic visualization of time series data.
- midje - Unit tests
Lumberjack artifacts are released to Clojars. If you are using Maven, add the following repository
definition to your pom.xml
:
<repository>
<id>clojars.org</id>
<url>http://clojars.org/repo</url>
</repository>
With Leiningen:
[lumberjack "0.1.0"]
With Maven:
<dependency>
<groupId>lumberjack</groupId>
<artifactId>lumberjack</artifactId>
<version>0.1.0</version>
</dependency>
To view a simple time series graph of the number of hits by the minute:
=> (use 'lumberjack.core)
=> (use 'lumberjack.nginx)
=> (use 'lumberjack.visualization)
(view-time-series (nginx-logs [path-to-nginx-log file]) :by timestamp-minute :grouping-name "minute")
Doing the above will give you a graph that looks like the following.
For very large log files you may need to update the project.clj file to include a setting for the allowed memory size via:
:jvm-opts ["-Xmx768M"]
and adjust the 768M to an appropriate number of megabytes.
Copyright © 2013 Steven Proctor
Distributed under the Eclipse Public License, the same as Clojure.