aspose file tools*
The moose likes Websphere and the fly likes log4j:ERROR Attempted to append to closed appender named [null]. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "log4j:ERROR Attempted to append to closed appender named [null]." Watch "log4j:ERROR Attempted to append to closed appender named [null]." New topic
Author

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

VedaKumar Kompalli
Greenhorn

Joined: Oct 07, 2005
Posts: 10
Hi ,
I am getting following errors on my console repeatedly

log4j:ERROR Attempted to append to closed appender named [null].
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

Somewhere your outputting logging statements without properly defining a logger. Alternatively, there may be a missing server setting somewhere although I'd bet on the first. Have you read through your log4j xml file for any idea?


My Blog: Down Home Country Coding with Scott Selikoff
VedaKumar Kompalli
Greenhorn

Joined: Oct 07, 2005
Posts: 10
Originally posted by Scott Selikoff:
Somewhere your outputting logging statements without properly defining a logger. Alternatively, there may be a missing server setting somewhere although I'd bet on the first. Have you read through your log4j xml file for any idea?
VedaKumar Kompalli
Greenhorn

Joined: Oct 07, 2005
Posts: 10
I repeatedly cross checked across the code, but now where i did any mistake while logging output statements.
VedaKumar Kompalli
Greenhorn

Joined: Oct 07, 2005
Posts: 10
I used following properties

log4j.logger.com.fm=INFO,dest1
log4j.appender.dest1=org.apache.log4j.RollingFileAppender
log4j.appender.dest1.File=logs/FileManager.log
log4j.appender.dest1.Append=true
log4j.appender.dest1.MaxFileSize=2MB
log4j.appender.dest1.MaxBackupIndex=10
log4j.appender.dest1.layout=org.apache.log4j.PatternLayout
log4j.appender.dest1.layout.ConversionPattern=date/time: %20d{dd MMM yyyy HH:mm:ss} %5p %c - %m%n
VedaKumar Kompalli
Greenhorn

Joined: Oct 07, 2005
Posts: 10
I used following properties

log4j.logger.com.fm=INFO,dest1
log4j.appender.dest1=org.apache.log4j.RollingFileAppender
log4j.appender.dest1.File=logs/FileManager.log
log4j.appender.dest1.Append=true
log4j.appender.dest1.MaxFileSize=2MB
log4j.appender.dest1.MaxBackupIndex=10
log4j.appender.dest1.layout=org.apache.log4j.PatternLayout
log4j.appender.dest1.layout.ConversionPattern=date/time: %20d{dd MMM yyyy HH:mm:ss} %5p %c - %m%n
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

The only line that concerns me is "log4j.logger.com.fm=INFO,dest1". Why aren't you using the more common root logger syntax such as "log4j.rootLogger=INFO,dest1". I would try this instead and see if it solves your problem.

I would also try using a Console Appender instead of a rolling, and see if anything is outputted to screen.
Jenny Uy
Greenhorn

Joined: Feb 09, 2007
Posts: 3
Just want to share how I got my "log4j:ERROR Attempted to append to closed appender named" problem resolved just in case some people bump into the same problem.

I have 2 log4j.properties files and I used the same appender name which caused the problem. I just changed the other appender name and no more error!
S Kannan
Greenhorn

Joined: Apr 05, 2010
Posts: 1
Jenny:thanks for the valuable information.

This problem also whens same appender type used in two properties file.

Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3219
    
  49

"kannan KannanGa", please check your private messages regarding an important administrative matter from JavaRanch.


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: log4j:ERROR Attempted to append to closed appender named [null].