Forums Register Login

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

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
As this has nothing to do with HTML, I have moved it to a more appropriate forum.
+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
Thanks,
I got it by using setUseParentHandlers(false)for Logger object.
Do the next thing next. That’s a pretty good rule. Read the tiny ad, that’s a pretty good rule, too.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 3472 times.
Similar Threads
Log message in SystemOut.log in WAS5.1x using Sun's logging API
Logging file
Log4j ...selective logging to appenders
process cannot access the file because another process has locked: java.util.Logging
Sun's Logger to log message in App Server log (SystemOut.log in WAS)
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 08:58:57.