Skip to content

Latest commit

 

History

History
41 lines (35 loc) · 892 Bytes

README.md

File metadata and controls

41 lines (35 loc) · 892 Bytes

graylog_logger

This is a basic library that uses standard erlang logger (OTP21 onwards) to output messages to graylog via UDP protocol

Quick start

Include this library into your project using rebar:

{graylog_logger, ".*", {git, "https://github.com/byronpc/graylog_logger.git", "master"}}

Kernel Configuration

[{kernel,
  [
    {logger, [
      {handler, default, undefined},
      {handler, graylog, graylog_logger, #{
        host => "localhost",
        port => 12201,
        compression => disabled | gzip | zlib,
        extra_fields => #{
          <<"_environment">> => <<"production">>
        },
        formatter => {
          logger_formatter, #{
              single_line => true,
              time_offset => "Z",
              template => [msg]
          }
        }
      }}
    ]},
    {logger_level, warning}
  ]}
].