Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
VedaKumar Kompalli
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4015
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I repeatedly cross checked across the code, but now where i did any mistake while logging output statements.
 
VedaKumar Kompalli
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4015
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jenny:thanks for the valuable information.

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

 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4511
271
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"kannan KannanGa", please check your private messages regarding an important administrative matter from JavaRanch.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic