| Author |
How can i add Log4j suppourt to my Application
|
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
Hello ,
How Can i add Log4j to my suppourt ??
A site says this thing :
Once you have added the log4j JAR file to your application, then you will need to setup log4j using either a log4j.properties or log4j.xml file.
I have a web application . i have added a log4j jar to my Application . Please tell me how can i add Log4j suppourt to my Application ??
|
Save India From Corruption - Anna Hazare.
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
Hi ,
I am using Log4j inside my class like this :
This is my properties file :
But this prints log statements in my IDE console only.
I want to have all these statements inside a File . Please tell me how can i do all these ??
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
Ravi Kiran V wrote:I want to have all these statements inside a File.
Sorry, which "statements" do you want to have inside a file? Your configuration will already be in a file, so it isn't clear what you mean by that sentence.
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
which "statements" do you want to have inside a file?
Inside my java class
My query is How can i have all these above statements inside a File (Rather than on to console).
Please tell me .
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
Okay. You really mean "How can I get the logging output from these statements into a file", right? You don't want the Java statements to be in a file, do you?
You will find programming is easier if you express yourself clearly. If you can't express what you want to do, you won't be able to write a program to do that.
But anyway, back to the question. Your properties file specifies a ConsoleAppender and nothing else. That's why the logging output goes to the console and nowhere else. If you want it to go to a file then you need to specify a FileAppender in the properties file.
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
|
Thank you paul .
|
 |
 |
|
|
subject: How can i add Log4j suppourt to my Application
|
|
|