rrudakov / timbre-syslog-remote

Timbre syslog appender with remote host support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Timbre syslog appender

https://img.shields.io/clojars/v/net.clojars.rrudakov/timbre-syslog-remote.svg

Third-party timbre syslog appender with remote host support.

The main purpose of this library is to provide a direct integration of timbre and Papertrail.

The format of messages is compliant with RFC 3164.

Status

The library is tested with papertrail and I don’t expect any breaking changes. It’s not tested with localhost, but it should work if syslog is configured properly (it should listen to the port 514).

Usage

deps.edn

net.clojars.rrudakov/timbre-syslog-remote {:mvn/version "0.1.3"}

Leiningen

[net.clojars.rrudakov/timbre-syslog-remote "0.1.3"]

Register appender

(require '[io.rrudakov.timbre.syslog :refer [syslog-appender]])

(binding [timbre/*config*
          (assoc-in timbre/*config* [:appenders :syslog]
                    (syslog-appender {:host           "logs2.papertrailapp.com"
                                      :port           99999
                                      :no-stacktrace? true
                                      :ident          "application.name"}))]

  (timbre/infof "This is my info %d" (rand-int 999)))

Configuration

All configuration parameters are optional.

:host
remote host to connect (default: localhost)
:port
UDP port (default: 514)
:ident
application name (default: nil)
:no-stacktrace?
if false stacktraces will be logged (default: false)

stacktraces

Syslog doesn’t support multiline log messages by default, but sometimes it’s useful to print exceptions with stacktraces. If option :no-stacktrace? is false, stacktrace will be sent line by line:

docs/img/stacktrace.png

About

Timbre syslog appender with remote host support

License:Eclipse Public License 2.0


Languages

Language:Clojure 100.0%