Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lager loglevels per application

Tags:

erlang

lager

How can I set different loglevels per application/library in Lager?

For example, I would like to see debug messages on the console, but only for my application, not for any libraries I use (eg. amqp_client).

like image 915
egbokul Avatar asked Feb 05 '16 11:02

egbokul


1 Answers

This can't be (easily) done with lager:debug, etc. However, with lager 3.x, you can now have multiple sinks, which means that you could define a sink named myapp, and use myapp:debug, etc.. Then you can configure the logging levels, filters and destinations independently for each sink.

like image 154
Roger Lipscombe Avatar answered Oct 02 '22 07:10

Roger Lipscombe