PSGI logging (Perl) -



PSGI logging (Perl) -

despite rather scant , unclear documentation , effective how-to beginners, have grown psgi , using in 1 of applications. know how manage logging across multi-node application? considered "best practice" regarding logging in psgi?

i recommend using plack::middleware::accesslog logging accessing , plack::middleware::logdispatch custom logging. both in turn utilize popular log::dispatch module.

the logdispatch middleware docs not show how utilize logging object 1 time set up. here's example:

my $app = sub { $env = shift; $env->{'psgix.logger'}->({ level => "debug", message => "this debug" }); homecoming [ 200, [], [] ]; };

to address multi-node concern, utilize log::dispatch::syslog send logging rsyslog in turn pass log info on rsyslog server. in way, nodes can log single central logging server.

with flexibility of log::dispatch, have alternative log both locally , remotely redundancy if like. logs sent central server considered primary, , logging done locally considered backup in case central log server downwards bit.

using central log server has several advantages:

you can 'grep' logs across entire cluster in 1 place. log rotation , analysis simpler 1 set of log files. you improve prepared scale cluster , down, can shut node off without worrying losing logging, or keeping server on overnight cron job can fire process logs.

i using log::dispach , rsyslog in way manage multi-node cluster myself.

perl logging psgi

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -