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 Michaël CATANZARITI <mc...@apache.org> on 2004/08/04 07:30:18 UTC

Re: Using XMLSocketAppender 'locationinfo' option.

Hi,

I have fixed the problem,

please checkout the following files in the CVS repository:

xmllayout.cpp
xmlsocketappender.cpp

Regards,

Christophe de VIENNE wrote:
> Michaël CATANZARITI wrote:
> 
>> Hi,
>>
>> I am afraid there is a bug in the XMLSocketAppender
>>
>> Please try to apply the following patch to the file 
>> xmlsocketappender.cpp :
>>
>> diff -r1.7 xmlsocketappender.cpp
>> 93a94,95
>>
>>>               XMLLayoutPtr xmlLayout = layout;
>>>               xmlLayout->setLocationInfo(locationInfo);
>>
>>
>>
>> and let me know if it works.
> 
> 
> 
> Unfortunately no.
> 
> Here are the symptoms :
> one my program side, After a few logging events, I have this message on 
> stderr:
> 
> Detected problem with connection:
> Connection reset by peer
> 
> 
> One chainsaw2 side, I have :
> 
> Level
> ERROR
> Logger
> org.apache.log4j.net.SocketNode
> Time
> 2004-06-29 09:51:57,986
> Thread
> Thread-0
> Message
> Unexpected exception. Closing connecition.
> NDC
> null
> Class
> 
> Method
> 
> Line
> 
> File
> 
> Properties
> {{log4jid,1}}
> Throwable
> java.lang.NullPointerException
>    at org.apache.log4j.xml.XMLDecoder.decodeEvents(Unknown Source)
>    at org.apache.log4j.xml.XMLDecoder.decodeEvents(Unknown Source)
>    at org.apache.log4j.net.XMLSocketNode.run(XMLSocketNode.java:137)
>    at java.lang.Thread.run(Thread.java:534)
> 
> 
> 
> Is there any test I can run to check the xml datas sent by log4cxx, so 
> we'll be able to tell if it's a decoding problem of chainsaw.
> 
> 
> 
> Christophe
> 
> 

-- 
Michaël CATANZARITI
log4cxx project manager

	log4cxx user mailing list:
	mailto:log4cxx-user-subscribe@logging.apache.org

	log4cxx developer mailing list:
	mailto:log4cxx-dev-subscribe@logging.apache.org

Re: Using XMLSocketAppender 'locationinfo' option.

Posted by Christophe de Vienne <cd...@alphacent.com>.
I see.

Why not using the __FUNCTION__ macro ? At least the method field could 
be filled.

Regards,

Christophe


Michaël CATANZARITI a écrit :

> the method and class fields cannot be easily filled in C++ because 
> there are no compilator builtin macros like __FILE__ or __LINE__
> Nevertheless, Chainsaw need to find the tags method and class in the 
> incoming XML stream even if those tags are empty.
> Before my fix, theses tags were not present in the log4cxx 
> XMLLayout/XMLSocketAppender and Chainsaw throwed exceptions. Now these 
> tags are present but empty. It's just to mislead Chainsaw.
>
> Michaël



Re: Using XMLSocketAppender 'locationinfo' option.

Posted by Michaël CATANZARITI <mc...@apache.org>.
the method and class fields cannot be easily filled in C++ because there are no compilator builtin macros like __FILE__ or __LINE__
Nevertheless, Chainsaw need to find the tags method and class in the incoming XML stream even if those tags are empty.
Before my fix, theses tags were not present in the log4cxx XMLLayout/XMLSocketAppender and Chainsaw throwed exceptions. 
Now these tags are present but empty. It's just to mislead Chainsaw.

Michaël

Christophe de VIENNE wrote:
> Michael CATANZARITI wrote:
> 
>> Yes,
>>
>> the "method" and "class" field are empty in Chainsaw. This information 
>> has to be
>> sent by log4cxx : it is exactly the fix I committed this morning.
>>  
>>
> 
> Well, but I was using the lastest CVS version, including your patch. Did 
> I miss an option to activate it (other that locationinfo) ?
> 
> 
> Christophe
> 
> 

-- 
Michaël CATANZARITI
log4cxx project manager

	log4cxx user mailing list:
	mailto:log4cxx-user-subscribe@logging.apache.org

	log4cxx developer mailing list:
	mailto:log4cxx-dev-subscribe@logging.apache.org

Re: Using XMLSocketAppender 'locationinfo' option.

Posted by Christophe de VIENNE <cd...@alphacent.com>.
Michael CATANZARITI wrote:

>Yes,
>
>the "method" and "class" field are empty in Chainsaw. This information has to be
>sent by log4cxx : it is exactly the fix I committed this morning.
>  
>

Well, but I was using the lastest CVS version, including your patch. Did 
I miss an option to activate it (other that locationinfo) ?


Christophe

Re: Using XMLSocketAppender 'locationinfo' option.

Posted by Michael CATANZARITI <mc...@free.fr>.
Yes,

the "method" and "class" field are empty in Chainsaw. This information has to be
sent by log4cxx : it is exactly the fix I committed this morning.

Michaël

Selon Christophe de VIENNE <cd...@alphacent.com>:

> Michaël CATANZARITI wrote:
>
> > Hi,
> >
> > I have fixed the problem,
>
>
> It's working. Thanks !
>
> I noticed another thing : the 'method' field is empty in chainsaw. Is
> the information supposed to be sent by xmlsocketappender ?
>
> Regards,
>
> Christophe
>



Re: Using XMLSocketAppender 'locationinfo' option.

Posted by Christophe de VIENNE <cd...@alphacent.com>.
Michaël CATANZARITI wrote:

> Hi,
>
> I have fixed the problem,


It's working. Thanks !

I noticed another thing : the 'method' field is empty in chainsaw. Is 
the information supposed to be sent by xmlsocketappender ?

Regards,

Christophe