File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Open Source Projects and the fly likes help write log4j output to a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "help write log4j output to a file" Watch "help write log4j output to a file" New topic

help write log4j output to a file

Bob Peterson
Ranch Hand

Joined: Jul 30, 2004
Posts: 47
I'm trying to get log4j up and running quickly for the first time. I just want to write everything to a file. What would the file look like for that? I've tried:


But I get log4j warnings :

log4j:WARN No appenders could be found for logger (Log4J).
log4j:WARN Please initialize the log4j system properly.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
You have probably fixed this yourself by now, but this is what I did to get your example to work:

Notice the level ALL on the rootLogger (rootCategory is obsolete) and the addition of the layout line.

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
I agree. Here's the link:
subject: help write log4j output to a file
It's not a secret anymore!