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 "Wilfong, Paul" <pa...@ngc.com> on 2008/02/22 02:10:14 UTC

Log4cxx - use of "location"

I can't seem to be able to get the "location" functionality right.

I'm running a C++ program with log4cxx, using the XMLAppender to write
to a socket.  The log4cxx properties file has the "locationInformation"
property set to true for this appender.

On the receiving machine I have SimpleSocketReceiver running with the
XML plugin, and appending to LogFactor5.

On the LogFactor5 display the "location" column shows "?.?(?:?)".

I have tried to use spi::LocationInfo to set the three arguments as seen
in "http://www.nabble.com/PatternLayouts-td13849523.html", but no luck.

Any assistance will be greatly appreciated.



Re: Log4cxx - use of "location"

Posted by Curt Arnold <ca...@apache.org>.
On Feb 21, 2008, at 7:10 PM, Wilfong, Paul wrote:

> I can't seem to be able to get the "location" functionality right.
>
> I'm running a C++ program with log4cxx, using the XMLAppender to  
> write to a socket.  The log4cxx properties file has the  
> "locationInformation" property set to true for this appender.
>
> On the receiving machine I have SimpleSocketReceiver running with  
> the XML plugin, and appending to LogFactor5.
>
> On the LogFactor5 display the "location" column shows "?.?(?:?)".
>
> I have tried to use spi::LocationInfo to set the three arguments as  
> seen in "http://www.nabble.com/PatternLayouts-td13849523.html", but  
> no luck.
>
> Any assistance will be greatly appreciated.
>
>

Have no clue with LogFactor 5.

Maybe some of Chainsaw's history might help.  Chainsaw previously used  
log4j 1.3 (now abandoned) which had an incompatible serialization  
format for events.  Chainsaw would then see locations from log4j 1.3  
apps, but not from log4j 1.2 apps.  Chainsaw has been migrated back to  
being based on log4j 1.2 + companions which contain backports of log4j  
1.3 features that it used, but it has not been pushed for release (on  
my list after log4cxx and cpptasks) which will now receive location  
from log4j 1.2 and log4cxx apps, but will lose the location from log4j  
1.3 apps.

I'm guessing that your LogFactor 5 might be based on log4j 1.3.

Sorry I can't help more than that.  Can your LogFactor 5 see events  
from a log4j 1.2 app?

Also, are you using the LOG4CXX_INFO et al macros.  If you are just  
doing logger->info("Hello, World"), no location information is  
available and there is no (at least no portable way) to get it from  
the context.