Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kobil-systems/lager_iowrite_formatter
Lager formatter that adds support for custom format specifiers to the metadata.
https://github.com/kobil-systems/lager_iowrite_formatter
erlang lager logging
Last synced: 2 days ago
JSON representation
Lager formatter that adds support for custom format specifiers to the metadata.
- Host: GitHub
- URL: https://github.com/kobil-systems/lager_iowrite_formatter
- Owner: kobil-systems
- License: apache-2.0
- Created: 2020-01-13T18:56:29.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-12T22:33:18.000Z (about 4 years ago)
- Last Synced: 2024-11-30T18:47:03.280Z (about 1 month ago)
- Topics: erlang, lager, logging
- Language: Erlang
- Homepage:
- Size: 17.6 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
lager_iowrite_formatter
=====![GitHub Workflow Status](https://img.shields.io/github/workflow/status/kobil-systems/lager_iowrite_formatter/Erlang%20CI?style=flat-square)
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`:
```erlang
{deps, [lager_iowrite_formatter]}.
```And then in `sys.config` you can use:
```erlang
{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.