• 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:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

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 ??
 
Marshal
Posts: 28296
95
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
Marshal
Posts: 28296
95
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 .
 
Seriously Rick? Seriously? You might as well just read this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic