This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 60740
    
  65

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to stop the console Logging using Java.util.Logging
 
Similar Threads
Logging file
Sun's Logger to log message in App Server log (SystemOut.log in WAS)
Log message in SystemOut.log in WAS5.1x using Sun's logging API
process cannot access the file because another process has locked: java.util.Logging
Log4j ...selective logging to appenders