Coder Social home page Coder Social logo

lager_syslog's Introduction

Overview

Travis-CI :: https://secure.travis-ci.org/basho/lager_syslog.png

This is a syslog backend for Lager. It allows you to send messages out of lager and into the local syslog daemon.

Configuration

Configure a Lager handler like the following:

{lager_syslog_backend, [Identity, Facility, Level]}

The Identity is the string to tag all messages with in syslog, usually the application’s name. The facility is the facility to log to (see the syslog documentation for a list of these). The Level is the lager level at which the backend accepts messages (eg. using ‘info’ would send all messages at info level or above into syslog). While you can filter messages at the syslog level, it will improve performance if you filter in lager instead.

An example for riak would look something like this:

{handlers, [
  {lager_syslog_backend, ["riak", local1, info]},
] },

Then in your syslog config remembering syslog likes tabs and not spaces:

local1.info                     /var/log/riak_info.log

If you want to log to multiple facilities at once, you can do something like the following:

{{lager_syslog_backend, "daemon facility"}, ["riak1", daemon, info]},
{{lager_syslog_backend, ftp}, ["riak2", ftp, notice]},

You MUST give each instance of the file backend its own identifier.

Refer to Lager’s documentation for futher information on configuring handlers.

Troubleshooting

There’s not a lot to go wrong, but if you are not receiving messages, check your syslog config and read its manpage for more information. OS X, in particular, has a very strange default config where it drops messages below the ‘info’ level by default.

lager_syslog's People

Contributors

andy-richards avatar jadeallenx avatar jaredmorrow avatar jtuple avatar qhartman avatar seancribbs avatar vagabond avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lager_syslog's Issues

lager_syslog rebar.config requires lager 1.x or 2.x, but pulls from lager master

The lager master branch currently contains lager 3.x.

lager_syslog requires lager version 1.x or 2.x, but pulls from lager master branch. This prevents one from building lager_syslog from a fresh repo clone. lager_syslog should probably pull from the 2.x branch.

I would make a PR myself, but I'm not sure which branches you'd like to have populated with the change.

See the following conversation with a bash shell for the repro recipe:

$ git clone https://github.com/basho/lager_syslog 2> /dev/null
$ cd lager_syslog
lager_syslog $ rebar g-d
WARN:  /tmp/lager_syslog/deps/lager/src/lager.app.src has version "3.0.1"; requested regex was (2.1|2.0|1.0|1.2).*
==> lager_syslog (get-deps)
WARN:  /tmp/lager_syslog/deps/lager/src/lager.app.src has version "3.0.1"; requested regex was (2.1|2.0|1.0|1.2).*
WARN:  /tmp/lager_syslog/deps/lager/src/lager.app.src has version "3.0.1"; requested regex was (2.1|2.0|1.0|1.2).*
ERROR: Dependency dir /tmp/lager_syslog/deps/lager failed application validation with reason:
{version_mismatch,{"/tmp/lager_syslog/deps/lager/src/lager.app.src",
                   {expected,"(2.1|2.0|1.0|1.2).*"},
                   {has,"3.0.1"}}}.
ERROR: 'get-deps' failed while processing /tmp/lager_syslog: rebar_abort

console line numbers version 1.2.1

Please close this issue sorry, this was meant for basho/lager not syslog. Apologies!

Hi, I've recently upgraded to Lager 1.2.1 and now our console configuration...

{lager_console_backend, [info, debug]},

... to print verbose MFA & line number details cause the following error...

"Lager failed to install handler lager_console_backend into lager_event"

lager_console_backend.erl line 39 was reported as the problem, and looking at the src i can see that the args [info, debug] is now only for backward compatibility. I changed the list to a single atom which solves the problem but i no longer have MFA, line numbers etc on the console when developing.

Thought it worth mentioning,

Andy.

remote syslog

How can I configure lager_syslog so that it would send the data on specific port and destination address?

Please add a License

Would you please be so kind as to add a license to this repository, so it is clear how it is licensed out?

I am assuming you are intending Apache V2, since that seems to be what you use, and also what is written in the header of lager_syslog_backend.erl, but if you could explicitly add a license, it would help greatly!

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.