This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Other Open Source Projects and the fly likes how to set the log file ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "how to set the log file ?" Watch "how to set the log file ?" New topic
Author

how to set the log file ?

Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
hi,

could someone tell me how to set the log file using commons logging ? i went through the site http://jakarta.apache.org/commons/logging/index.html but i didnt not find anything good for me there . Am i missing anything ? I just want to write the log details to c:\mylog.log when i execute my java program.

Thanks,
Rajeev
JigaR Parekh
Ranch Hand

Joined: May 23, 2005
Posts: 112
Rajeev,

Commons Loggin is just Logging Wrapper. This can be used to remove compile-time and run-time dependencies on any particular logging package.

For configuration you have to depend on perticular loggin api you are using like log4j,jdk logging or any other logging api.

Look at below link u will find out.

Configuration of Commons logging

Jigar
[ October 25, 2005: Message edited by: JigaR Parekh ]
MInu
Ranch Hand

Joined: Oct 09, 2003
Posts: 517
create a log4j.properties file
******************************
log4j.rootCategory=INFO, dest
#specify the destination file
log4j.appender.dest=org.apache.log4j.RollingFileAppender
#specify the destination where you want to display your messages
log4j.appender.dest.File=C:/mylogfile

hope this will help you!


God Gave Me Nothing I Wanted<br />He Gave Me Everything I Needed<br /> - Swami Vivekananda
Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
Thanks Jigar / Minu..

I was having the feeling that common-logging is just another tool like log4j. I was in hurry and was checking the tutorial for setting up the property files.. my bad! Thanks again to point me to the right direction.

Rajeev.
 
Consider Paul's rocket mass heater.
 
subject: how to set the log file ?