<p>I didn&#39;t catch you guys. Let me make my problem clearer.</p>
<p>My catalyst application handles the auth process and I want Apache writes username into its log files, just like using Apache&#39;s basic auth module.</p>
<div class="gmail_quote">2012/04/20 21:59 &quot;Tomas Doran&quot; &lt;<a href="mailto:bobtfish@bobtfish.net">bobtfish@bobtfish.net</a>&gt;:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On 20 Apr 2012, at 12:56, Eden Cardim wrote:<br>
<br>
&gt;&gt;&gt;&gt;&gt;&gt; &quot;Hailin&quot; == Hailin Hu &lt;<a href="mailto:i@h2l.name">i@h2l.name</a>&gt; writes:<br>
&gt;    Hailin&gt; Finally, something like below works for me.<br>
&gt;<br>
&gt;    Hailin&gt; my $apache = $c-&gt;engine-&gt;env-&gt;{&#39;psgi.input&#39;}; #<br>
&gt;    Hailin&gt; Apache2::RequestRec $apache-&gt;user( $username );<br>
&gt;<br>
&gt;    Hailin&gt; I supposed that an accessor of apache should be a method instead<br>
&gt;    Hailin&gt; of a key of hash.  Is this the right way to retrieve the<br>
&gt;    Hailin&gt; apache/mod_perl object?<br>
&gt;<br>
&gt; No it&#39;s not, this ties your application to a specific backend server<br>
&gt; implementation (which is what caused your problem in the first<br>
&gt; place). Whenever you need to access $c-&gt;engine-&gt;env, you should be applying a<br>
&gt; Plack::Middleware to your .psgi instead.<br>
<br>
For this specific thing, there is already $c-&gt;req-&gt;remote_user, which should get this - no?<br>
<br>
<a href="https://metacpan.org/module/Catalyst::Request#req-remote_user" target="_blank">https://metacpan.org/module/Catalyst::Request#req-remote_user</a><br>
<a href="http://search.cpan.org/~bobtfish/Catalyst-Plugin-Authentication-0.10018/lib/Catalyst/Authentication/Credential/Remote.pm" target="_blank">http://search.cpan.org/~bobtfish/Catalyst-Plugin-Authentication-0.10018/lib/Catalyst/Authentication/Credential/Remote.pm</a><br>

<br>
Cheers<br>
t0m<br>
<br>
<br>
_______________________________________________<br>
List: <a href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br>
</blockquote></div>