bryan_basho
bryan_basho

Reputation: 159

Lager test logging from the console

Lets say I attach to a running Erlang application and I change the lager configuration from the console, by running:

lager:set_loglevel(lager_console_backend,"console.log", debug).

I then want to test it by issuing a command like:

lager:debug(<<"test">>).

But that won't work because Lager is implemented using parse tranformation at compile time.

Surely there must is a more verbose command which will work. Does such an instruction exist?

Upvotes: 3

Views: 1125

Answers (1)

bryan_basho
bryan_basho

Reputation: 159

Solution, used the backwards compatable log API (without the parse transform).

([email protected])4> lager:log(error, "console", "foo"). ok

Verified it worked, using tail -f:

tail -f ./dev1/logs/console.log 2014-07-29 17:12:21.255 [error] foo

Upvotes: 3

Related Questions