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ü <ce...@qos.ch> on 2003/06/02 22:24:31 UTC

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


At 06:41 PM 5/29/2003 -0500, you wrote:
>Hi all,
>
>TIA for any help on this.

Hi Ralph,

Please let other lists know about your conclusions as appropriate. I am not 
cross posting.

>At this stage I'm just trying to nail down which party to
>focus on. It seems there might be a gotcha related to
>FreeBSD Linux emulation or that a log4j or ofbiz
>developer might be able to guide me in the right
>direction for how to debug this. Any help from any
>party is much appreciated.
>
>The following line is appearing on my server's console:
>
>    log4j:ERROR Attempted to append to closed appender named [stdout].

[snip]

The internal log4j messages are sufficient to diagnose the problem. For 
some reason, the root logger is parsed twice. When PropertyConfigurator 
parses a file, each time it encounters a logger, it starts by closing all 
the appenders attached to that logger. Since the root logger is configured 
twice, the stdout appender is attached to root the first time the root 
logger is configured. In the second round, all the appenders in root are 
closed. Thus, stdout is closed. However, it since it is mentioned in root 
logger, it is attached to root logger again but it is already closed.

Either the log4j.properties file that ships with jakarta-poi-1.5.1-final is 
buggy or there is a problem with the
java.util.Properties implementation in your environment.

HTH,

>16:24:17.905 EVENT  Statistics on = false for 
>org.mortbay.jetty.Server@1cec00f0
>16:24:18.004 EVENT  Starting Jetty/4.2.9
>16:24:18.025 EVENT  Started org.mortbay.http.NCSARequestLog@1cf961e2
>16:24:18.633 EVENT  Started WebApplicationContext[/commonapp,Open For 
>Business - commonapp]
>log4j: Trying to find [log4j.xml] using context classloader 
>org.mortbay.http.ContextLoader(file:/root/ofbiz/commonapp/webapp/WEB-INF/classes/) 
>/ java.net.URLClassLoader@1cf6a9bf.
>log4j: Trying to find [log4j.xml] using java.net.URLClassLoader@1cf6a9bf 
>class loader.
>log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource().
>log4j: Trying to find [log4j.properties] using context classloader 
>org.mortbay.http.ContextLoader(file:/root/ofbiz/commonapp/webapp/WEB-INF/classes/) 
>/ java.net.URLClassLoader@1cf6a9bf.
>log4j: Using URL 
>[jar:file:/root/ofbiz/lib/share/jakarta-poi-1.5.1-final.jar!/log4j.properties] 
>for automatic log4j configuration.
>log4j: Reading configuration from URL 
>jar:file:/root/ofbiz/lib/share/jakarta-poi-1.5.1-final.jar!/log4j.properties
>log4j: Parsing for [root] with value=[FATAL, stdout].
>log4j: Level token is [FATAL].
>log4j: Category root set to FATAL
>log4j: Parsing appender named "stdout".
>log4j: Parsing layout options for "stdout".
>log4j: Setting property [conversionPattern] to [%-4r [%t] %-5p %c %x - %m%n].
>log4j: End of parsing for "stdout".
>log4j: Parsed "stdout" options.
>log4j: Parsing for [org] with value=[FATAL,  stdout].
>log4j: Level token is [FATAL].
>log4j: Category org set to FATAL
>log4j: Parsing appender named "stdout".
>log4j: Appender "stdout" was already parsed.
>log4j: Handling log4j.additivity.org=[null]
>log4j: Finished configuring.
>log4j: Parsing for [root] with value=[ALL, stdout].
>log4j: Level token is [ALL].
>log4j: Category root set to ALL
>log4j: Parsing appender named "stdout".
>log4j: Parsing layout options for "stdout".
>log4j: Setting property [conversionPattern] to [%-5r[%24F:%-3L:%-5p]%x %m%n].
>log4j: End of parsing for "stdout".
>log4j: Parsed "stdout" options.
>log4j: Parsing for [org.ofbiz] with value=[INFO].
>log4j: Level token is [INFO].
>log4j: Category org.ofbiz set to INFO
>log4j: Handling log4j.additivity.org.ofbiz=[null]
>log4j: Parsing for [freemarker] with value=[INFO].
>log4j: Level token is [INFO].
>log4j: Category freemarker set to INFO
>log4j: Handling log4j.additivity.freemarker=[null]
>log4j: Parsing for [NoModule] with value=[INFO].
>log4j: Level token is [INFO].
>log4j: Category NoModule set to INFO
>log4j: Handling log4j.additivity.NoModule=[null]
>log4j: Parsing for [org.ofbiz.core.control] with value=[ALL].
>log4j: Level token is [ALL].
>log4j: Category org.ofbiz.core.control set to ALL
>log4j: Handling log4j.additivity.org.ofbiz.core.control=[null]
>log4j: Parsing for [org.jpublish] with value=[INFO].
>log4j: Level token is [INFO].
>log4j: Category org.jpublish set to INFO
>log4j: Handling log4j.additivity.org.jpublish=[null]
>log4j: Finished configuring.
>log4j:ERROR Attempted to append to closed appender named [stdout].
>0    [     ControlServlet.java:62 :INFO ] [ControlServlet.init] Loading 
>Control Servlet mounted on path /root/ofbiz/commonapp/webapp/
>
>
>I can provide lots more detail, but I'm hoping the above is
>enough. Anyone have any ideas? Thanks for reading this far
>and any ideas you might have.
>
>--
>ralph mellor

--
Ceki  For log4j documentation consider "The complete log4j manual"
       ISBN: 2970036908  http://www.qos.ch/shop/products/clm_t.jsp 


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