aspose file tools*
The moose likes Java in General and the fly likes Java Logging API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java Logging API" Watch "Java Logging API" New topic
Author

Java Logging API

Dan McKay
Greenhorn

Joined: Aug 19, 2007
Posts: 3
Hi,

Firstly, I'd just like to say that I hope I've posted this question in the right forum. (I've looked all over the web for help, so I think my question is pretty tough).

Basically, I am trying to learn about the Java Logging API. Rather than use the default config file (in jre/lib directory) to set logging levels, I want to use my own config file.

I need to start my java application without any extra arguments at the command line and have the LogManager object disregrard the default config file and read settings from my own config file instead.

Here's what I've got so far:





...and here's my properties file:





The problem is that I only get log messages displayed down to the INFO level. It seems to me as though I'm still getting the inherited settings from the root logger. This is not what I want.

Can anyone help...?

THANKS!
Jeff Storey
Ranch Hand

Joined: Apr 07, 2007
Posts: 230
Hi Dan,

This isn't really a direct answer to your question, but I wanted to suggest using Apache's log4j logger instead of the Java logging (I've used the Java logging a couple of times, but nothing too detailed). It's pretty much the standard for Java logging (you'll see a lot of similarities to the Java logging mostly because the Java logging is built on the same concepts of log4j).

More importantly, you'll find all sorts of help on the web for log4j since so many people use it. I hope this is of some help, but feel free to follow up with more questions.

Jeff
Dan McKay
Greenhorn

Joined: Aug 19, 2007
Posts: 3
Hi Jeff,

Thanks for your advice - I'll give the Apache logger a go and see how I get on!
 
wood burning stoves
 
subject: Java Logging API