This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Facing a problem with java.util.logging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Facing a problem with java.util.logging" Watch "Facing a problem with java.util.logging" New topic

Facing a problem with java.util.logging

Nag raja

Joined: Jan 25, 2010
Posts: 5
I'm using java.util.logging to log my statemets. Here i'm using only FileHandler.No where i'm using ConsoleHandler, eventhough the logged stements are appearing both on the file and on the console.
I dont want console output. I only want File outout.
I tried with the follwing code but it's throwing ArrayIndexOutofBoundsException

Please help me at this context.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

From the javadoc ArrayIndexOutofBoundsException
Thrown to indicate that an array has been accessed with an illegal index. The index is either negative or greater than or equal to the size of the array.

So apparently the array is empty.

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Nag raja

Joined: Jan 25, 2010
Posts: 5
Then please suggest me how can i terminate the output to Console?
Nag raja

Joined: Jan 25, 2010
Posts: 5
Finally i got the solution by looking into the logging API

The method i used is setUseParentHandlers(false);

Finally it stops sending output to console and now i'm seeing output in File only.

Thanks friends

I agree. Here's the link:
subject: Facing a problem with java.util.logging
Similar Threads
Log message in SystemOut.log in WAS5.1x using Sun's logging API
I can't seem to set the log level on my package
Sun's Logger to log message in App Server log (SystemOut.log in WAS)
terminating a console program
java.util.Logging configuration...