You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inside qrauth_worker:request/1 I do a gen_server:cast which is handled by the code above.
When I run the escript this is the output in the console:
>>./worker
11:07:35.394 [info] Application lager started on node nonode@nohost
11:07:35.399 [info] Application amqp_client started on node nonode@nohost
11:07:35.443 [info] Info msg
11:07:35.443 [warning] Warming msg
Which is the expected output according to my lager statements and my lager config.
But my info.log and debug.log files are empty.
To make things a bit more weird for me, if I include a lager:error statement this one flushes the log to the files but fails to output the error msg to the console.
>>./worker
11:07:35.394 [info] Application lager started on node nonode@nohost
11:07:35.399 [info] Application amqp_client started on node nonode@nohost
11:07:35.443 [info] Info msg
11:07:35.443 [warning] Warming msg
Notice that the [error] log is missing in the console output
And this is my info.log
>>cat info.log
2012-07-14 11:17:24.379 [info] <0.6.0> Application lager started on node nonode@nohost
2012-07-14 11:17:24.384 [info] <0.6.0> Application amqp_client started on node nonode@nohost
2012-07-14 11:17:24.424 [info] <0.75.0>@qrauth_worker:init:62 Starting worker
2012-07-14 11:17:24.434 [info] <0.75.0>@qrauth_worker:handle_cast:93 Info msg
2012-07-14 11:17:24.434 [warning] <0.75.0>@qrauth_worker:handle_cast:95 Warming msg
2012-07-14 11:17:24.435 [error] <0.75.0>@qrauth_worker:handle_cast:96 Error msg
Any hints or ideas. Thanks
The text was updated successfully, but these errors were encountered:
My best guess is that your escript is exiting before everything is flushed to disk and/or the console. The [error] loglevel forces a fdatasync, so that is why it makes your logs suddenly work, but there's no way to force a flush to the console.
Hi,
I have just started to play with Lager so probably I'm doing something but I'm no able to log to file.
My setup:
I have included the lager_transform directive in rebar.config
I have copied the lager app config to my app.config
Inside my code I have several calls to lager
I have an escript script to run a quick test:
Inside qrauth_worker:request/1 I do a gen_server:cast which is handled by the code above.
When I run the escript this is the output in the console:
>>./worker 11:07:35.394 [info] Application lager started on node nonode@nohost 11:07:35.399 [info] Application amqp_client started on node nonode@nohost 11:07:35.443 [info] Info msg 11:07:35.443 [warning] Warming msg
Which is the expected output according to my lager statements and my lager config.
But my info.log and debug.log files are empty.
To make things a bit more weird for me, if I include a lager:error statement this one flushes the log to the files but fails to output the error msg to the console.
This is the code with the lager:error
This is the console output
>>./worker 11:07:35.394 [info] Application lager started on node nonode@nohost 11:07:35.399 [info] Application amqp_client started on node nonode@nohost 11:07:35.443 [info] Info msg 11:07:35.443 [warning] Warming msg
Notice that the [error] log is missing in the console output
And this is my info.log
Any hints or ideas. Thanks
The text was updated successfully, but these errors were encountered: