Giter Site home page Giter Site logo

lager_rsyslog's Introduction

lager_rsyslog

This library application provides an Rsyslog backend for Lager. It allows you to send messages from your Erlang application to a remote rsyslog daemon.

This backend is based on the lager_syslog backend from Basho.

Configuration

Configure a Lager handler like the following:

{lager_rsyslog_backend, [
    {host, Hostname},       % The hostname of the rsyslog server
    {port, Port},           % The rsyslog port, defaults to 514
    {identity, Identity},   % A name for this application
    {facility, Facility},   % The rsyslog facility, defaults to local2
    {level, Level},         % The log level threshold
    {formatter, {           % A custom message formatter
        FormatterModule,    %   The formatter module name
        FormatterConfig     %   The formatter config
    }}           
]}

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 rsyslog 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.

You can refer to the Lager documentation for using a syslog style level definition for configuring the level thresholds which allows more flexibility than the simple threshold.

An example for Apache CouchDB might look something like this:

{handles, [
    {lager_rsyslog_backend, [
        {identity, "couchdb"},
        {facility, local2},
        {level, info}
    ]}
]}

Multiple lager_rsyslog_backend handlers can be specified but you MUST use unique identity values for each handler. Refer to Lager's documentation for further information on configuring handlers.

Configuring Rsyslog is left as an exercise for the reader.

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.