Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Lager logs errors when the standard error logger does not #153

Open
xcrdev opened this Issue · 6 comments

2 participants

@xcrdev

Hello I have a supervisor that has a restart strategy of {one_for_all, 0, 1} and a child with a restart of permanent. With Lager errors get logged when the child goes down with {stop, normal, NewState} but the standard error logger doesn't report errors when I do this. Is this considered a bug or working as intended? Either way I don't want errors logged in this situation, is there something I can do to suppress these?

-Xavier

@xcrdev

These are the errors being logged:

2013-06-16 15:59:09.939 [error] Supervisor {,player_sup} had child tcp_server started with tcp_server:start_link(#Port, #Fun, ) at exit with reason normal in context child_terminated

2013-06-16 15:59:09.939 [error] Supervisor {,player_sup} had child tcp_server started with tcp_server:start_link(#Port, #Fun, ) at exit with reason reached_max_restart_intensity in context shutdown

@Vagabond
Collaborator

If you start SASL, does it log errors? I don't recall if the standard error_logger even knows about supervisor reports.

@xcrdev

Yes starting with SASL logs errors. I've never seen these supervisor reports before because I never used SASL. This is what it looks like in SASL:

=SUPERVISOR REPORT==== 20-Jun-2013::19:05:43 ===
Supervisor: {,player_sup}
Context: child_terminated
Reason: normal
Offender: [{pid,},
{name,tcp_server},
{mfargs,{tcp_server,start_link,
[#Port,
#Fun,
]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]

=SUPERVISOR REPORT==== 20-Jun-2013::19:05:43 ===
Supervisor: {,player_sup}
Context: shutdown
Reason: reached_max_restart_intensity
Offender: [{pid,},
{name,tcp_server},
{mfargs,{tcp_server,start_link,
[#Port,
#Fun,
]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]

I guess the thing that threw me off is that Lager was indicating they were errors but my code is working as I intended and SASL doesn't indicate either way if it is an error it just shows this as additional supervisor information.

I don't know if you guys want to do anything with this. If I can though I would like to disable the supervisor reports if there is a way of configuring lager to do so? Because the error log is getting polluted with this kind of info which in my case is not an error.

@xcrdev

I would also like to add that I do not believe setting up a supervisor with a restart strategy of {one_for_all, 0, 1} and a child with a restart of permanent should give me errors when it shuts down. I'm very intentionally telling Erlang/OTP if any of these children die kill all children and then the supervisor.

@Vagabond
Collaborator

Yes, it isn't clear to me what to do with those kinds of messages. Normal and shutdown exit statuses should not log as errors, though.

@xcrdev

My preference would be that they go in the debug category or something like it so they don't show up in info or error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.