sub startup { # ... my $r_begin = $self->routes; my $r = $r_begin->under('' => sub { my $c = shift; my $params = $c->req->params->to_hash; # do your logging here }); # # your endpoints here # # catch-all route at end, your fancy 404 page and also place for log +ging $r->any('/*whatever' => {whatever => ''} => sub { my $c = shift; my $message = 'PAGE 404 '.$c->tx->{original_remote_address}." ".$c +->tx->req->url; $self->app->log->debug($message); # . Dumper($c->tx) $c->render(status => 404, text => $message); }); }
In reply to Re: request logging with Mojolicious
by alexander_lunev
in thread request logging with Mojolicious
by tomgracey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |