MT#4229 Remove dump from logfile.

The stack-trace is undecodeable from syslog, and it usually doesn't
provide any additional infos on top of the actual error message.
gjungwirth/fix_tests
Andreas Granig 12 years ago
parent 329b831918
commit 1d873fce27

@ -1,12 +1,8 @@
package NGCP::Panel::Controller::Root;
use Sipwise::Base;
BEGIN { extends 'Catalyst::Controller' }
use Carp qw(longmess);
use Convert::Ascii85 qw();
use Data::Dumper qw(Dumper);
use DateTime qw();
use DateTime::Format::RFC3339 qw();
use IO::Compress::Xz qw(xz);
use NGCP::Panel::Widget;
use Scalar::Util qw(blessed);
use Time::HiRes qw();
@ -147,23 +143,7 @@ sub end :Private {
my $incident = DateTime->from_epoch(epoch => Time::HiRes::time);
my $incident_id = sprintf '%X', $incident->strftime('%s%N');
my $incident_timestamp = DateTime::Format::RFC3339->new->format_datetime($incident);
my $crash_state;
$c->log->error(join(q(), @{ $c->error }));
if ($c->config->{log_crash_state}) {
local $Data::Dumper::Indent = 1;
local $Data::Dumper::Useqq = 1;
local $Data::Dumper::Deparse = 1;
local $Data::Dumper::Quotekeys = 0;
local $Data::Dumper::Sortkeys = 1;
my $buffer;
xz(\(join(q(), @{ $c->error }) . longmess . Dumper($c) . Dumper($c->config)), \$buffer);
$crash_state = Convert::Ascii85::encode($buffer);
$crash_state =~ s/(.{80})/$1\n/g;
}
$c->log->error(
"Exception id $incident_id at $incident_timestamp crash_state:" .
($crash_state ? ("\n" . $crash_state) : ' disabled')
);
$c->log->error("fatal error, id=$incident_id, timestamp=$incident_timestamp, error=".join(q(), @{ $c->error }));
$c->clear_errors;
$c->stash(
exception_incident => $incident_id,

@ -10,9 +10,6 @@ log4perl.appender.Default.layout=PatternLayout
log4perl.appender.Default.layout.ConversionPattern=%d{ISO8601} [%p] [%F +%L] %m{chomp}%n
# perhaps also add: host=%H pid=%P
# each crash state is <50 KiB
log_crash_state 0
<Model::DB>
schema_class NGCP::Schema
</Model::DB>
@ -82,5 +79,3 @@ log_crash_state 0
keyfile /etc/ssl/ngcp/api/ca-key.pem
certfile /etc/ssl/ngcp/api/ca-cert.pem
</ssl>
cache_root /run/shm

@ -118,7 +118,8 @@ $(function () {
-%]
$('a').each(function() {
var _text = $(this).text().trim();
if(_text == "Back" ||
if(_text == "Back" ||
$(this).hasClass('ngcp-error-button') ||
$(this).hasClass('accordion-toggle') ||
$(this).parents('#footer').length ||
$(this).parents('#topbar').length) {

@ -4,32 +4,24 @@
<div class="error-container">
<h1>Oops!</h1>
<h1>Sorry!</h1>
<h2>[% c.response.status %] Internal server error </h2>
<div class="error-details">
<p>Sorry, an exceptional error has occured:</p>
<ul>
<li>incident number: [% exception_incident %]</li>
<li>time of incident: [% exception_timestamp %]</li>
</ul>
<p>We are terribly sorry, an exceptional error has occured:</p>
<div><strong>incident number:</strong> [% exception_incident %]</div>
<div><strong>time of incident:</strong> [% exception_timestamp %]</div>
<br/>
<p>Details have been logged on the server. If you want to report the error,
describe what you were doing or attempting to do just before.</p>
</div> <!-- /error-details -->
<div class="error-actions">
<a href="[% c.uri_for('/back') %]" class="btn btn-large btn-primary">
<i class="icon-chevron-left"></i>
&nbsp;
Back to Dashboard
</a>
<a href="mailto:[% c.config.contact.email %]" class="btn btn-large">
<i class="icon-envelope"></i>
&nbsp;
Contact Support
</a>
<a href="[% c.uri_for('/back') %]" class="btn btn-large btn-primary ngcp-error-button">
<i class="icon-chevron-left"></i> Back to Dashboard</a>
<a href="mailto:[% c.config.contact.email %]?subject=NGCP-Panel Incident [% exception_incident %]" class="btn btn-large ngcp-error-button">
<i class="icon-envelope"></i> Contact Support</a>
</div> <!-- /error-actions -->

Loading…
Cancel
Save