You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Ceki Gülcü <cg...@qos.ch> on 2001/04/20 17:44:07 UTC

Re: log4j:ERROR Attempted to append to closed appender named [null].

Michael,

This error occurs when you attempt to invoke the doAppend method of a closed appender. The error comes from code in AppenderSkeleton. Is your system multi-threaded? How do ensure that another thread is not attempting to write while  you are closing the appender? Ceki 

At 10:22 20.04.2001 -0500, Michael Roytman wrote:
>Hi,
>
>we have written a log4j log server which is a socketserver MBean
>instrumented by a JDMK agent.
>One of the server's tasks is to create socket appenders
>and forward logging events to the clients.
>When the client is stopped or deleted, I close the appender and
>remove it from the category. The events are no longer sent but
>I get a log4j error:
>log4j:ERROR Attempted to append to closed appender named [null].
>Is there anything else I need to do except closing and removing the
>appender?
>Thanks.
>
>Michael Roytman
>Novarra, Inc.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org

--
Ceki Gülcü


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: log4j:ERROR Attempted to append to closed appender named [null].

Posted by Ceki Gülcü <cg...@qos.ch>.
Michael,

Hate to follow up on my self but the question in my previous mail gives the impression that log4j is not thread-safe. Log4j is of course thread safe. My question is how do you ensure that a separate thread is not attempting to the appender after it is removed from a category but before it is closed? Do you see what I mean? Ceki



At 17:44 20.04.2001 +0200, you wrote:

>Michael,
>
>This error occurs when you attempt to invoke the doAppend method of a closed appender. The error comes from code in AppenderSkeleton. Is your system multi-threaded? How do ensure that another thread is not attempting to write while  you are closing the appender? Ceki 
>
>At 10:22 20.04.2001 -0500, Michael Roytman wrote:
>>Hi,
>>
>>we have written a log4j log server which is a socketserver MBean
>>instrumented by a JDMK agent.
>>One of the server's tasks is to create socket appenders
>>and forward logging events to the clients.
>>When the client is stopped or deleted, I close the appender and
>>remove it from the category. The events are no longer sent but
>>I get a log4j error:
>>log4j:ERROR Attempted to append to closed appender named [null].
>>Is there anything else I need to do except closing and removing the
>>appender?
>>Thanks.
>>
>>Michael Roytman
>>Novarra, Inc.
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>
>--
>Ceki Gülcü
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org

--
Ceki Gülcü


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org