aspose file tools*
The moose likes Beginning Java and the fly likes How to stop the console Logging using Java.util.Logging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to stop the console Logging using Java.util.Logging" Watch "How to stop the console Logging using Java.util.Logging" New topic
Author

How to stop the console Logging using Java.util.Logging

bhuvani krishna
Greenhorn

Joined: Dec 20, 2006
Posts: 7
Hi,
I am using java.util.Logging in my application. I want to log all the info and error messages into a log file. In this no problem for me. But in addition to logging into the file, It will also display the same log messages on the console.How to stop the console messages.Please help me out.

Thanks,
Bhuvani
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

As this has nothing to do with HTML, I have moved it to a more appropriate forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Logging to the console is the default behavior and is specified in a properties file in jre/lib dir.

In this java.util.logging article Jason Hunter says to create your own properties file to use instead and specify it with a system property:

java -Djava.util.logging.config.file=mylogging.properties MyClass

The LogManager Javadoc API mentions this and another option for configuring.
[ January 03, 2007: Message edited by: Carol Enderlin ]
bhuvani krishna
Greenhorn

Joined: Dec 20, 2006
Posts: 7
Thanks,
I got it by using setUseParentHandlers(false)for Logger object.
 
 
subject: How to stop the console Logging using Java.util.Logging