Giter Club home page Giter Club logo

graylog_lager's Introduction

graylog_lager

Build Status GitHub Hex.pm

Lager is a standard logging tool for Erlang, this project crates lager formatter to output messages in GELF format and lager backend to send messages via UDP to a graylog server.

Features

  • Support for compression gzip or zlib
  • Support for chunk encoded GELF messages
  • Works with lager 3.x

Quick start

Include this backend into your project using rebar:

{graylog_lager, ".*", {git, "https://github.com/silviucpp/graylog_lager.git", "master"}}

Then you need to add a new handler in lager configuration, usually in your app.config file, for example:

{lager, [
    {handlers, [
        {graylog_lager_udp_backend, [
            {host, "127.0.0.1"},
            {port, 12201},
            {level, info},
            {format_config, [
                {compression, disabled},
                {extra_fields, [
                    {<<"_environment">>, <<"production">>}
                ]}
            ]}
        ]}
    ]}
]}

Configuration

Backend configuration parameters:

  • host: graylog server host, example: {host, "127.0.0.1"}
  • port: graylog server port, example: {port, 12201}
  • level: minimum logging level - messages below that level will be dropped. One of the above values (debug, info, notice, warning, error, critical, alert)
  • format_config: backend-specific configuration - a proplist with:
    • compression: one of disabled, gzip, zlib (atom, defaults to disabled)
    • extra_fields: optional proplist of {name, value}, they will be sent as additional fields to graylog. The name must be a binary starting with an underscore, while the value must be any term.
    • hostname: optional binary with the hostname. If not provided will be automatically detected.
  • formatter: In case you want to change the GELF formatter module. Default : {formatter, graylog_lager_gelf_formatter}
  • chunk_size: The max size of each UPD packet: default 8154. Valid value between interval 1420 - 8154. Example: {chunk_size, 8154}
  • inet_family: Specify the inet family. Default to inet. Supported values inet or inet6

Also support the following sink configs described in lager readme:

  • high_water_mark
  • flush_queue
  • flush_threshold

graylog_lager's People

Contributors

silviucpp avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

graylog_lager's Issues

Licence file is omitted

Hello. Could you please clarify and commit licence file for that project?
Something like apache2 will be perfect :)
Thanks.

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.