Skip to content

Lager formatter that adds support for custom format specifiers to the metadata.

License

Notifications You must be signed in to change notification settings

kobil-systems/lager_iowrite_formatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lager_iowrite_formatter

GitHub Workflow Status

Lager formatter that adds support for custom format specifiers to the metadata. It is especially useful when you want to format numbers in different format.

Usage

Add to rebar.config:

{deps, [lager_iowrite_formatter]}.

And then in sys.config you can use:

{lager, [
  {handlers, [
    {lager_file_backend, [{file, "error.log"}, {level, error}, {formatter, lager_iowrite_formatter},
      {formatter_config, [date, " ", time, {"~.16B", trace_id, "undefined"}," [",severity,"] ",pid, " ", message, "\n"]}]}
  ]}
]}.

That will print trace_id metadata attribute using hexadecimal format if value is present.

About

Lager formatter that adds support for custom format specifiers to the metadata.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages