Last active
January 4, 2016 01:59
-
-
Save eiri/8552138 to your computer and use it in GitHub Desktop.
Lager part in erlang's app.config for colored console output with info on module and line of logged message
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{lager, [ | |
{handlers, [ | |
{lager_console_backend, [ | |
debug, | |
{lager_default_formatter, [time, " ", {module, | |
[module, {line, [":", line], ""}], ""}, " ", color, message, {eol, "\e[0m\r\n"}]} | |
]}, | |
{lager_file_backend, | |
[{file, "logs/console.log"}, {level, info}, {size, 10485760}, {date, "$D0"}, {count, 1}]}, | |
{lager_file_backend, | |
[{file, "logs/error.log"}, {level, error}, {size, 10485760}, {date, "$D0"}, {count, 1}]} | |
]}, | |
{colored, true}, | |
{crash_log, "logs/crash.log"}, | |
{crash_log_msg_size, 65536}, | |
{crash_log_size, 10485760}, | |
{crash_log_date, "$D0"}, | |
{crash_log_count, 1} | |
]}]. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
colors() -> | |
lager:debug("Lager debug"), | |
lager:info("Lager info: ~p", [self()]), | |
lager:notice("Lager notice"), | |
lager:warning("Lager warning msg"), | |
lager:error("Lager error"), | |
lager:critical("Lager critical"), | |
lager:alert("Lager alert"), | |
lager:emergency("Lager emergency"). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment