mirror of
https://gitlab.com/depesz/explain.depesz.com.git
synced 2024-11-24 08:42:27 +02:00
Bring back log
This was removed by change in Mojolicious. While doing it, make it autorotate every day.
This commit is contained in:
parent
937cf53ddc
commit
14428d818f
1
cpanfile
1
cpanfile
@ -21,5 +21,6 @@ requires 'Mojolicious';
|
||||
requires 'Pg::Explain', '>= 2.4';
|
||||
requires 'Number::Bytes::Human';
|
||||
requires 'Pg::SQL::PrettyPrinter';
|
||||
requires 'MojoX::Log::Rotate'
|
||||
|
||||
# vim: set ft=perl:
|
||||
|
@ -1,10 +1,17 @@
|
||||
package Explain;
|
||||
|
||||
use Mojo::Base 'Mojolicious';
|
||||
use MojoX::Log::Rotate;
|
||||
|
||||
sub startup {
|
||||
my $self = shift;
|
||||
|
||||
my $log = MojoX::Log::Rotate->new(
|
||||
'path' => $self->home->child( 'log', $self->mode . '.log' ),
|
||||
'frequency' => 86400
|
||||
);
|
||||
$self->log( $log );
|
||||
|
||||
$self->sessions->cookie_name( 'explain' );
|
||||
$self->sessions->default_expiration( 60 * 60 * 24 * 365 );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user