This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

How can i add Log4j suppourt to my Application

 
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ??
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ??
 
Sheriff
Posts: 26958
84
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Sheriff
Posts: 26958
84
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you paul .
reply
    Bookmark Topic Watch Topic
  • New Topic