Skip to content

a lager formatter that produces json

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

irccloud/lager2json

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lager2json

a lager formatter that produces json

Build Status

using lager2json

when configuring lager specify lager2json as the formatter:

{lager, [
  {handlers, [
    {lager_console_backend, [info, {lager2json, []}]},
    {lager_file_backend, [
      {file, "error.log"},
      {level, error},
      {formatter, lager2json},
      {formatter_config, []}
    ]},
  ]}
]}.

then call lager as you normally would:

ok = lager:info("hallo world", []).
%% {"message":"hallo world","metadata":{"application":"lager2json","module":"some_module","function":"some_function","line":7,"pid":"<0.249.0>","node":"nonode@nohost"},"severity":"info","timestamp":"2016-02-29T00:38:44.954229Z"}

configuration

lager2json supports the following configuration options

  • {separator, Separator} append the separator (a binary) after the json output. useful when writing to the console or file

all configuration options should be passed as a proplist

licensing and copyright

lager2json is available under either the MIT or Apache 2.0 licenses. see the relevant LICENSE-* file included with this application

copyright 2016 alisdair sullivan

About

a lager formatter that produces json

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Erlang 88.5%
  • Elixir 11.5%