You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Andreas Fester <An...@gmx.de> on 2005/11/13 21:40:21 UTC
Re: Problem in using NDC in log4cxx-0.9.8
Hi Munir,
note that log4cxx-user is the proper list for log4cxx related
questions :-)
I dont think that your issue is related to NDC
directly. I tried the following:
BasicConfigurator::configure();
logger->debug ("message0");
log4cxx::NDC::push ("(a)");
logger->debug ("message1");
log4cxx::NDC::pop ();
logger->debug ("message2");
and also get a "null" for the first logging request, before
having executed any NDC specific operations:
4 [0xb772e8e0] DEBUG org.apache.log4j.NDCTestCase null - message0
5 [0xb772e8e0] DEBUG org.apache.log4j.NDCTestCase (a) - message1
5 [0xb772e8e0] DEBUG org.apache.log4j.NDCTestCase null - message2
So I think it is more an issue of the layout pattern,
which tries to render the name of the NDC, which is null for the
top level NDC.
How do you configure log4cxx? Are you also using the
BasicConfigurator, or a specific configuration?
I dont know yet how log4j behaves in this case, have to
find this out first...
Regards,
Andreas
Munir Badir wrote:
> Hi,
>
> I once used log4cxx-0.9.7 and the result of the following:
>
>
>
> log4cxx::NDC::push ("(a)");
>
> logger->debug ("message1");
>
> log4cxx::NDC::pop ();
>
> logger->debug ("message2");
>
>
>
>
>
> was:
>
> .. (a) message1
>
> ... message2
>
>
>
> And now when I'm using the log4cxx-0.9.8 the result is:
>
> .. (a) message1
>
> ... null message2
--
Andreas Fester
mailto:andreas@littletux.net
WWW: http://www.littletux.net
ICQ: 326674288
Re: Problem in using NDC in log4cxx-0.9.8
Posted by Andreas Fester <An...@gmx.de>.
> and also get a "null" for the first logging request, before
> having executed any NDC specific operations:
>
> 4 [0xb772e8e0] DEBUG org.apache.log4j.NDCTestCase null - message0
> 5 [0xb772e8e0] DEBUG org.apache.log4j.NDCTestCase (a) - message1
> 5 [0xb772e8e0] DEBUG org.apache.log4j.NDCTestCase null - message2
[...]
> I dont know yet how log4j behaves in this case, have to
> find this out first...
Just tried this with an equivalent java application
and log4j 1.3 alpha6, and the output is the same:
0 [main] DEBUG org.apache.log4j.NDCTestCase null - message0
5 [main] DEBUG org.apache.log4j.NDCTestCase (a) - message1
5 [main] DEBUG org.apache.log4j.NDCTestCase null - message2
So, this is something which can also be discussed
on the log4j list after all, since the behaviour
of log4cxx is compliant to log4j in this case ;-)
Regards,
Andreas
--
Andreas Fester
mailto:andreas@littletux.net
WWW: http://www.littletux.net
ICQ: 326674288
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Problem in using NDC in log4cxx-0.9.8
Posted by Andreas Fester <An...@gmx.de>.
> and also get a "null" for the first logging request, before
> having executed any NDC specific operations:
>
> 4 [0xb772e8e0] DEBUG org.apache.log4j.NDCTestCase null - message0
> 5 [0xb772e8e0] DEBUG org.apache.log4j.NDCTestCase (a) - message1
> 5 [0xb772e8e0] DEBUG org.apache.log4j.NDCTestCase null - message2
[...]
> I dont know yet how log4j behaves in this case, have to
> find this out first...
Just tried this with an equivalent java application
and log4j 1.3 alpha6, and the output is the same:
0 [main] DEBUG org.apache.log4j.NDCTestCase null - message0
5 [main] DEBUG org.apache.log4j.NDCTestCase (a) - message1
5 [main] DEBUG org.apache.log4j.NDCTestCase null - message2
So, this is something which can also be discussed
on the log4j list after all, since the behaviour
of log4cxx is compliant to log4j in this case ;-)
Regards,
Andreas
--
Andreas Fester
mailto:andreas@littletux.net
WWW: http://www.littletux.net
ICQ: 326674288