{"action":"created","issue":{"url":"https://api.github.com/repos/chiselwright/plack-app-fakeapache1/issues/4","labels_url":"https://api.github.com/repos/chiselwright/plack-app-fakeapache1/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/chiselwright/plack-app-fakeapache1/issues/4/comments","events_url":"https://api.github.com/repos/chiselwright/plack-app-fakeapache1/issues/4/events","html_url":"https://github.com/chiselwright/plack-app-fakeapache1/issues/4","id":38877733,"number":4,"title":"Internal server errors are getting logged as \"WARNS\"","user":{"login":"chiselwright","id":85526,"avatar_url":"https://avatars.githubusercontent.com/u/85526?v=3","gravatar_id":"","url":"https://api.github.com/users/chiselwright","html_url":"https://github.com/chiselwright","followers_url":"https://api.github.com/users/chiselwright/followers","following_url":"https://api.github.com/users/chiselwright/following{/other_user}","gists_url":"https://api.github.com/users/chiselwright/gists{/gist_id}","starred_url":"https://api.github.com/users/chiselwright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chiselwright/subscriptions","organizations_url":"https://api.github.com/users/chiselwright/orgs","repos_url":"https://api.github.com/users/chiselwright/repos","events_url":"https://api.github.com/users/chiselwright/events{/privacy}","received_events_url":"https://api.github.com/users/chiselwright/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chiselwright/plack-app-fakeapache1/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-07-28T10:22:38Z","updated_at":"2015-11-01T21:25:33Z","closed_at":null,"body":"Raised (a long time ago) after some testing at my workplace:\r\n\r\n```\r\nWith PSGI-XT now in production, the internal server errors are getting logged as \"WARNS\" in xtracker-<date>.log. \r\nEarlier to that, such errors were logged in apache-error.log with the 'FATAL' log level.\r\n\r\nXTracker/Logfile.pm has the following:\r\n\r\n$SIG{__DIE__} = sub { ## no critic\r\n                if ((!defined($^S)) || ($^S)) {\r\n                    return;\r\n                }\r\n                local $Log::Log4perl::caller_depth = $Log::Log4perl::caller_depth + 1;\r\n                my $logger = Log::Log4perl->get_logger(\"\");\r\n                $logger->fatal(@_);\r\n                die @_; # Now terminate really\r\n            };\r\n\r\nFollowing this, my initial thoughts were that the internal server errors should also get logged as FATAL.\r\nSince thats not the case, I checked it further and it seems that the following code in /opt/xt/xt-perl/lib/site_perl/5.14.4/Plack/App/FakeModPerl1/Dispatcher.pm is responsible for logging these errors as warnings.\r\n\r\n    try {\r\n        if ($module->isa('Catalyst')) {\r\n            say \"$module is part of the Great Catalyst Hackup\";\r\n        }\r\n        else {\r\n            no strict 'refs';\r\n            $res = &{\"${module}::handler\"}($plack)\r\n                if $module->can('handler');\r\n            say \"no handler() in $module\"\r\n                unless $module->can('handler');\r\n        }\r\n    }\r\n    catch ($e) {\r\n        Carp::cluck( \"$module->handler(): $e\" );\r\n        # if we error we override the status of everything up to this point!\r\n        return HTTP_INTERNAL_SERVER_ERROR;\r\n    }\r\n\r\nAs you can see , catch block uses the carp routine with cluck function that basically logs with WARN log level (considering it a non fatal error).\r\n\r\nQuestions:\r\n1) Do you think the module (Plack/App/FakeModPerl1/Dispatcher.pm) is doing the right thing shown above?\r\n2) Can this be updated to use confess instead to ensure that an internal server error is logged as FATAL. \r\n3) If not, can you please suggest a better approach for this?\r\n\r\nThanks\r\nMamta\r\n```"},"comment":{"url":"https://api.github.com/repos/chiselwright/plack-app-fakeapache1/issues/comments/152865048","html_url":"https://github.com/chiselwright/plack-app-fakeapache1/issues/4#issuecomment-152865048","issue_url":"https://api.github.com/repos/chiselwright/plack-app-fakeapache1/issues/4","id":152865048,"user":{"login":"chiselwright","id":85526,"avatar_url":"https://avatars.githubusercontent.com/u/85526?v=3","gravatar_id":"","url":"https://api.github.com/users/chiselwright","html_url":"https://github.com/chiselwright","followers_url":"https://api.github.com/users/chiselwright/followers","following_url":"https://api.github.com/users/chiselwright/following{/other_user}","gists_url":"https://api.github.com/users/chiselwright/gists{/gist_id}","starred_url":"https://api.github.com/users/chiselwright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chiselwright/subscriptions","organizations_url":"https://api.github.com/users/chiselwright/orgs","repos_url":"https://api.github.com/users/chiselwright/repos","events_url":"https://api.github.com/users/chiselwright/events{/privacy}","received_events_url":"https://api.github.com/users/chiselwright/received_events","type":"User","site_admin":false},"created_at":"2015-11-01T21:25:33Z","updated_at":"2015-11-01T21:25:33Z","body":"I'll have to try to get someone from the reporting team to provide more information."}}