diff --git a/Makefile.PL b/Makefile.PL index a66804fc34..5c2be17da1 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -17,6 +17,7 @@ requires 'Moose'; requires 'namespace::autoclean'; requires 'Config::General'; # This should reflect the config file format you've chosen # See Catalyst::Plugin::ConfigLoader for supported formats +requires 'Log::Log4perl::Catalyst'; test_requires 'Test::More' => '0.88'; catalyst; diff --git a/lib/NGCP/Panel.pm b/lib/NGCP/Panel.pm index 4bc9ce0c31..01b9ecbb5e 100644 --- a/lib/NGCP/Panel.pm +++ b/lib/NGCP/Panel.pm @@ -25,6 +25,7 @@ use Catalyst qw/ Session::Store::FastMmap Session::State::Cookie /; +use Log::Log4perl::Catalyst qw(); extends 'Catalyst'; @@ -135,6 +136,8 @@ __PACKAGE__->config( } ); +__PACKAGE__->log(Log::Log4perl::Catalyst->new('ngcp_panel.conf')); + # Start the application __PACKAGE__->setup(); diff --git a/lib/NGCP/Panel/Controller/Login.pm b/lib/NGCP/Panel/Controller/Login.pm index d85abc36d8..fdccb2706e 100644 --- a/lib/NGCP/Panel/Controller/Login.pm +++ b/lib/NGCP/Panel/Controller/Login.pm @@ -38,7 +38,7 @@ sub index :Path Form { ); if($form->validated) { - print ">>>>>> login form validated\n"; + $c->log->debug("login form validated"); my $user = $form->field('username')->value; my $pass = $form->field('password')->value; $c->log->debug("*** Login::index user=$user, pass=$pass, realm=$realm"); diff --git a/lib/NGCP/Panel/Widget/Plugin/AdminBillingOverview.pm b/lib/NGCP/Panel/Widget/Plugin/AdminBillingOverview.pm index 7c8d6525ca..cb8c546738 100644 --- a/lib/NGCP/Panel/Widget/Plugin/AdminBillingOverview.pm +++ b/lib/NGCP/Panel/Widget/Plugin/AdminBillingOverview.pm @@ -10,7 +10,7 @@ has 'template' => ( around handle => sub { my ($foo, $self, $c) = @_; - print "++++ AdminBillingOverview::handle\n"; + $c->log->debug("AdminBillingOverview::handle"); return; }; diff --git a/lib/NGCP/Panel/Widget/Plugin/AdminPeeringOverview.pm b/lib/NGCP/Panel/Widget/Plugin/AdminPeeringOverview.pm index b743ba1143..c877ab7304 100644 --- a/lib/NGCP/Panel/Widget/Plugin/AdminPeeringOverview.pm +++ b/lib/NGCP/Panel/Widget/Plugin/AdminPeeringOverview.pm @@ -10,7 +10,7 @@ has 'template' => ( around handle => sub { my ($foo, $self, $c) = @_; - print "++++ AdminPeeringOverview::handle\n"; + $c->log->debug("AdminPeeringOverview::handle"); return; }; diff --git a/lib/NGCP/Panel/Widget/Plugin/AdminResellerOverview.pm b/lib/NGCP/Panel/Widget/Plugin/AdminResellerOverview.pm index aaec88c06f..1c449ed22f 100644 --- a/lib/NGCP/Panel/Widget/Plugin/AdminResellerOverview.pm +++ b/lib/NGCP/Panel/Widget/Plugin/AdminResellerOverview.pm @@ -10,7 +10,7 @@ has 'template' => ( around handle => sub { my ($foo, $self, $c) = @_; - print "++++ AdminResellerOverview::handle\n"; + $c->log->debug("AdminResellerOverview::handle"); return; }; diff --git a/lib/NGCP/Panel/Widget/Plugin/AdminSystemOverview.pm b/lib/NGCP/Panel/Widget/Plugin/AdminSystemOverview.pm index c441e7f2f3..db6d801fed 100644 --- a/lib/NGCP/Panel/Widget/Plugin/AdminSystemOverview.pm +++ b/lib/NGCP/Panel/Widget/Plugin/AdminSystemOverview.pm @@ -10,7 +10,7 @@ has 'template' => ( around handle => sub { my ($foo, $self, $c) = @_; - print "++++ AdminSystemOverview::handle\n"; + $c->log->debug("AdminSystemOverview::handle"); return; }; diff --git a/lib/NGCP/Panel/Widget/Plugin/ResellerDomainOverview.pm b/lib/NGCP/Panel/Widget/Plugin/ResellerDomainOverview.pm index c1cec148d0..7d641d515d 100644 --- a/lib/NGCP/Panel/Widget/Plugin/ResellerDomainOverview.pm +++ b/lib/NGCP/Panel/Widget/Plugin/ResellerDomainOverview.pm @@ -10,7 +10,7 @@ has 'template' => ( around handle => sub { my ($foo, $self, $c) = @_; - print "++++ ResellerDomainOverview::handle\n"; + $c->log->debug("ResellerDomainOverview::handle"); return; }; diff --git a/ngcp_panel.conf b/ngcp_panel.conf index 102ddc3105..42f52f6c2f 100644 --- a/ngcp_panel.conf +++ b/ngcp_panel.conf @@ -1,3 +1,11 @@ # rename this file to ngcp::panel.yml and put a ':' after 'name' if # you want to use YAML like in old versions of Catalyst name NGCP::Panel + +log4perl.logger=INFO, Default +log4perl.appender.Default=Log::Log4perl::Appender::Screen +log4perl.appender.Default.stderr=0 +log4perl.appender.Default.utf8=1 +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