[Catalyst] Log4Perl and Catalyst startup routing table

Adam Witney awitney at sgul.ac.uk
Mon Nov 17 15:14:01 GMT 2014

> -----Original Message-----
> From: Aristotle Pagaltzis [mailto:pagaltzis at gmx.de]
> Sent: 13. novembra 2014 20:22
> To: catalyst at lists.scsys.co.uk
> Subject: Re: [Catalyst] Log4Perl and Catalyst startup routing table
> Hi Adam,
> * Adam Witney <awitney at sgul.ac.uk> [2014-11-13 12:45]:
> > I saw this post, but I 'm not sure I can use it to get the Catalyst
> > normal startup output in my logs. Is this possible?
> I guess you could make half a work-around with this module, by writing a
> plugin that uses the module to log this data manually during startup.
> How satisfactory that is I cannot say, since that depends on whether you also
> want the normal debug output to not to go to screen and whether you need
> debug mode in general.
> The problem with redirecting this stuff is that Catalyst produces the debug
> output very early during its startup, before it has loaded any extensions or
> plugins, so the logging facilities are the built-in stuff.
> (Hm, maybe it is possible to load the logging-related modules yourself and
> then hack them in with BEGIN or some such.) The code to produce this
> output is part of the startup code and not well accessible separately (which is
> the whole reason for CatalystX::Info after all).
> I.e. Catalyst basically doesn’t support what you want, and any solution done
> without built-in support will be ugly in some way or other.
> However maybe it can be modularised to support this. The tricky part of that
> is that you do want to output this info early, so that it will be useful for
> debugging e.g. when components break during loading – but OTOH it should
> optionally be subject to the user’s configured logging system. How do you
> resolve that contradiction? The rest of a new design should fall out of the
> answer to that question automatically.

Thanks for the suggestions.

It turns out that if you use

log4perl.logger.MyApp = DEBUG, Screen

then you lose all the standard Catalyst output, but if you use

log4perl.rootLogger = DEBUG, Screen

then you get it back again.



More information about the Catalyst mailing list