• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
  • Tim Holloway
  • Carey Brown
  • salvin francis

how to set up commons logging?

Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am using commons logging to do debugging:


I can debug as the following:
private static Log log = LogFactory.getFactory().getInstance(


The problem is how I can set up (e.g., a logging location
which has a file)and check the debugging results?

Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The deal with jakarta commons-logging (JCL) is that it uses whatever underlying configuration files it can get it's greedy paws on.

So, for example, if you put log4j.jar in your classpath, and supplied a log4j config file, then JCL will use that configuration (as best it can).

I'm a huge fan of log4j myself, so I'd recommend that package.

If you don't want to use that, and if you're using JDK1.4, then JCL will attempt to use the logging config the the jdk's java.util.logging package. I've never used that one, but I understand you can configure it a number of different ways. Not sure if you can do so *through* JCL though (probably not though).

finally, if you don't have log4j or jdk1.4, you get down to JCL's SimpleLogger, which it looks like you have to configure through system properties? That doesn't seem right though.

I found all this by :
(sorry, no web link for that one, but you should be able to puzzle one out).

I should make it clearer too: I meant by recommending using log4j that you use log4j exclusively, without wrapping it in commons-logging.

Finally, this is not really a Apache (web server) or Tomcat question, so I'll move this to 'Other Java APIs'
[ June 03, 2004: Message edited by: Mike Curwen ]
If somebody says you look familiar, tell them you are in porn. Or in these tiny ads:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!