[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-httpd-users
Subject:    Re: [users@httpd] Re: Logging issues with custom Apache2 module
From:       Tom Noonan <tom () joinroot ! com>
Date:       2019-02-06 21:09:47
Message-ID: CAJRE-ozjVRQ9NZW3yV05=vf16Yhh_p4F_M9Edrmx9gq6hbXp_Q () mail ! gmail ! com
[Download RAW message or body]

This was the bit I was missing!  Thanks!

--Tom Noonan II


On Wed, Feb 6, 2019 at 3:45 PM Eric Covener <covener@gmail.com> wrote:

> On Wed, Feb 6, 2019 at 3:38 PM Tom Noonan <tom@joinroot.com> wrote:
> >
> > Good afternoon:
> >
> > I've written a custom Apache2 module and I'm having some difficulty with
> logging.  Logging is working as expected using the global log level.  For
> example, if I set the following I get debug logs from my module:
> >
> > LogLevel Debug
> >
> > However, if I attempt to set the loglevel for only my module I do not
> see debug logs:
> >
> > LogLevel Warn mod_proxy_jwt_auth.c:Debug
> >
> > In looking at the logs I see other modules output "[date]
> [module_name:level]" whereas mine is outputting "[date] [:level]".  I'm
> guessing this is a factor in the per-module log level not working and that
> I'm getting some part of the module API wrong.  However, I reviewed
> https://httpd.apache.org/docs/2.4/developer/modguide.html and I simply
> don't see my error.
> >
> > The source of my module is here:
> https://github.com/Root-App/mod_proxy_jwt_auth/blob/master/mod_proxy_jwt_auth.c
> >
> > Can anyone advise?  Thanks!
> >
> > --Tom Noonan II
>
> There is a slightly different way to do do the AP_MODULE_DECLARE_DATA
> stuff in 2.4 that results in this macro being added to your code:
>
> APLOG_USE_MODULE(proxy_jwt_auth)
>
> You can also just add it explicitly, which is needed if you use
> multiple C files for the module.
>
> The alternate way is module AP_MODULE_DECLARE_DATA
> mod_proxy_jwt_auth_module; at the top and
> AP_DECLARE_MODULE(proxy_jwt_auth) -- you should see that pattern in
> the standard mods in 2.4.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

[Attachment #3 (text/html)]

<div dir="ltr"><div>This was the bit I was missing!   \
Thanks!</div><div><br></div><div><div><div dir="ltr" class="gmail_signature" \
data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><span \
style="font-size:12.8px">--Tom Noonan \
II</span><br></div></div></div></div></div></div><br></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 6, 2019 at 3:45 PM \
Eric Covener &lt;<a href="mailto:covener@gmail.com">covener@gmail.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Feb 6, 2019 at \
3:38 PM Tom Noonan &lt;<a href="mailto:tom@joinroot.com" \
target="_blank">tom@joinroot.com</a>&gt; wrote:<br> &gt;<br>
&gt; Good afternoon:<br>
&gt;<br>
&gt; I&#39;ve written a custom Apache2 module and I&#39;m having some difficulty with \
logging.   Logging is working as expected using the global log level.   For example, \
if I set the following I get debug logs from my module:<br> &gt;<br>
&gt; LogLevel Debug<br>
&gt;<br>
&gt; However, if I attempt to set the loglevel for only my module I do not see debug \
logs:<br> &gt;<br>
&gt; LogLevel Warn mod_proxy_jwt_auth.c:Debug<br>
&gt;<br>
&gt; In looking at the logs I see other modules output &quot;[date] \
[module_name:level]&quot; whereas mine is outputting &quot;[date] [:level]&quot;.   \
I&#39;m guessing this is a factor in the per-module log level not working and that \
I&#39;m getting some part of the module API wrong.   However, I reviewed <a \
href="https://httpd.apache.org/docs/2.4/developer/modguide.html" rel="noreferrer" \
target="_blank">https://httpd.apache.org/docs/2.4/developer/modguide.html</a> and I \
simply don&#39;t see my error.<br> &gt;<br>
&gt; The source of my module is here: <a \
href="https://github.com/Root-App/mod_proxy_jwt_auth/blob/master/mod_proxy_jwt_auth.c" \
rel="noreferrer" target="_blank">https://github.com/Root-App/mod_proxy_jwt_auth/blob/master/mod_proxy_jwt_auth.c</a><br>
 &gt;<br>
&gt; Can anyone advise?   Thanks!<br>
&gt;<br>
&gt; --Tom Noonan II<br>
<br>
There is a slightly different way to do do the AP_MODULE_DECLARE_DATA<br>
stuff in 2.4 that results in this macro being added to your code:<br>
<br>
APLOG_USE_MODULE(proxy_jwt_auth)<br>
<br>
You can also just add it explicitly, which is needed if you use<br>
multiple C files for the module.<br>
<br>
The alternate way is module AP_MODULE_DECLARE_DATA<br>
mod_proxy_jwt_auth_module; at the top and<br>
AP_DECLARE_MODULE(proxy_jwt_auth) -- you should see that pattern in<br>
the standard mods in 2.4.<br>
<br>
---------------------------------------------------------------------<br>
To unsubscribe, e-mail: <a href="mailto:users-unsubscribe@httpd.apache.org" \
target="_blank">users-unsubscribe@httpd.apache.org</a><br> For additional commands, \
e-mail: <a href="mailto:users-help@httpd.apache.org" \
target="_blank">users-help@httpd.apache.org</a><br> <br>
</blockquote></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic