<br><br><div class="gmail_quote">On Thu Nov 13 2014 at 20:22:51 Aristotle Pagaltzis &lt;<a href="mailto:pagaltzis@gmx.de" target="_blank">pagaltzis@gmx.de</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Adam,<br>
<br>
* Adam Witney &lt;<a href="mailto:awitney@sgul.ac.uk" target="_blank">awitney@sgul.ac.uk</a>&gt; [2014-11-13 12:45]:<br>
&gt; I saw this post, but I &#39;m not sure I can use it to get the Catalyst<br>
&gt; normal startup output in my logs. Is this possible?<br>
<br>
The problem with redirecting this stuff is that Catalyst produces the<br>
debug output very early during its startup, before it has loaded any<br>
extensions or plugins, so the logging facilities are the built-in stuff.<br>
(Hm, maybe it is possible to load the logging-related modules yourself<br>
and then hack them in with BEGIN or some such.) The code to produce this<br>
output is part of the startup code and not well accessible separately<br>
(which is the whole reason for CatalystX::Info after all).<br>
<br><br></blockquote><div><br></div><div>I&#39;ve had success with this sort of approach, by overriding finalize_config in the base class:</div><div><br></div><div> =head2 finalize_config</div><div><br></div><div>After config merging is complete initialise log4perl as our logger and enrich the available version info</div><div><br></div><div>=cut</div><div><br></div><div>sub finalize_config {</div><div>  my $class = shift;</div><div><br></div><div>  $class-&gt;next::method(@_);</div><div><br></div><div>  $class-&gt;log( Log::Log4perl::Catalyst-&gt;new( $class-&gt;config-&gt;{logfile} ) );</div><div><br></div><div>  my $visible_version = $class-&gt;_describe_version;</div><div>  $class-&gt;config-&gt;{version} = $visible_version;</div><div>  $class-&gt;log-&gt;info( &quot;Starting version: [&quot; . $visible_version-&gt;{name} . &quot;]&quot; );</div><div>}</div><div><br></div><div>Something like that should do what you need.</div><div><br></div><div>--</div><div>Scott</div></div>