The internal logger is quite "simple" in that it logs with different levels, but don't really care much aside from that.

A very common construction in my programs is:

$c->log->debug("amg, nevah show this in prod please") if $c->debug

myapp_server.pl -d only sets $c->debug to true, but the default logger doesn't care much.

A good/better alternative comes with Catalyst::Log::Log4perl, which converts $c->log into a Log::Log4perl logger (more or less at least), which lets you configure at a nice granularity what gets logged where and when.


- andreas

On Feb 25, 2008, at 10:25 PM, Tyler Bird wrote:

hi I want to only show certain log messages to my console based on the log level 'debug' I believe catalyst supports log levels, but this doesn't seem to be working


if ( $c->is_debug() )
{
  $c->log("log message here..");
}


It seems to be sending the log message no matter if ( $c->is_fatal() )



I even start the server with myapp_server.pl -d debug

What am I missing here does catalyst only have debug log level or not debug log level and not log levels in general?

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to