This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to set the log file ?

 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 517
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic