aspose file tools*
The moose likes Other Open Source Projects and the fly likes log4j XML properties file problem. 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 "log4j XML properties file problem." Watch "log4j XML properties file problem." New topic
Author

log4j XML properties file problem.

Mike Anna
Ranch Hand

Joined: Jul 08, 2007
Posts: 117
Dear all,
I wanted a simple thing from my application. Seperate levels of logging should be logged in seperate files. I did post about this in one another place tho. After a lot of readin, I figrured that filters can only be used in an XML file I made an XMl file and a java class to test it. Alas, I am still getting errors. here are the details :


********************************************************

Heres my java file :
*********************

********************
heres the XML configuration:
*********************

Could some body please tell what wrong am I doing here ?

thanks in advance for your time spent
Mike Anna
Ranch Hand

Joined: Jul 08, 2007
Posts: 117
hola,
Anything wrong with the question ??
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
java.lang.ClassNotFoundException: org.apache.log4j.PatternLayout


The runtime is not finding org.apache.log4j.PatternLayout in the classpath.

Is log4j-x.x.jar present in the classpath during runtime ?


Rahul Bhattacharjee
LinkedIn - Blog
Mike Anna
Ranch Hand

Joined: Jul 08, 2007
Posts: 117
Is log4j-x.x.jar present in the classpath during runtime ?

Yes it is. Logging as such works fine if I use a simple properties file and append all levels into one single file. Of course,thats not what I want. Since filters are the only way I can append into different files, and filters are possible only with an xml file. I am using the above, and having problems
Has anyone tried to do this (seperate levels of logs into seperate log files)? If yes please let me know the approach for this.
thanks in advance
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Why is that giving java.lang.ClassNotFoundException: org.apache.log4j.PatternLayout if the classes are present in the classpath ?
Mike Anna
Ranch Hand

Joined: Jul 08, 2007
Posts: 117
Why is that giving java.lang.ClassNotFoundException: org.apache.log4j.PatternLayout if the classes are present in the classpath ?


Good Question. Just that .. I dont know.
May be I will do a fresh download and set afresh the classpath.
Could some body use this code on their machine and let me know if it works there. I am still stuck with this without any clue.
Please help.

TIA
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Actually, it's not finding "org.apache.log4j.PatternLayout " in the classpath....notice the SPACE in quotes after PatternLayout.

Notice that there are several of those mis-configurations in your xml file.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: log4j XML properties file problem.