Lager Question: how to get the pid:module:function format

Sean Cribbs sean at
Sat Mar 31 10:29:11 EDT 2012


You'll need to enable Lager's parse transform. The easiest way to do that is to add the {parse_transform, lager_transform} to your compile options in rebar.config.

Sean Cribbs

On Mar 31, 2012, at 3:13 AM, Bryan Hughes <bryan at> wrote:

> Hello,
> I have been using Lager for several months now to much success.  One thing that I have not figured out though is how to get our output to match that of what the limited documentation claims.  According to the blog post:
> It states:
> Now, those were messages coming out of error_logger, which is fine for legacy or library code, but Lager also has its own logging API that you can       use. It's actually implemented via a parse_transform so that Lager can capture the current module, function, line number and pid for inclusion in the log message. All this is done automatically, and the logging call in the code looks like this:
> lager:error("oh no!")
> lager:warning("~s, ~s and ~s, oh my!"
> _______________________________________________
> riak-users mailing list
> riak-users at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the riak-users mailing list