Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2006

Tip: Looking for answers? Try searching our database.

how to log enum (toValue) exceptions with java.util.logging?

Thread view: 
Frank - 06 Dec 2006 21:58 GMT
I have a command line application, where I am trying to log all errors
to a file, and keep the commandline quiet.

In certain instances, I am getting some exceptions with
java.lang.Enum.valueOf (eg: java.lang.IllegalArgumentException: No enum
const class org....).  The exception is being logged into my file just
fine.  Problem is, it's also appearing on command line.

To control logging, I'm pretty much using a properties file based off
this example:
http://www.exampledepot.com/egs/java.util.logging/Props.html

With these changes:
# Set the default logging level for new FileHandler instances
java.util.logging.FileHandler.level = INFO
java.util.logging.ConsoleHandler.level = OFF

Any ideas on what else I can do to surpress the enum errors from the
command line?
Daniel Pitts - 07 Dec 2006 03:33 GMT
> I have a command line application, where I am trying to log all errors
> to a file, and keep the commandline quiet.
[quoted text clipped - 15 lines]
> Any ideas on what else I can do to surpress the enum errors from the
> command line?

I suggest creating an ssccee (read about it
<http://www.physci.org/codes/sscce/>)  That way we can get more
information.

I'm guessing that someone somewhere is catching that exception, calling
System.out.println, or e.printStackTrace(), and then rethrowing it.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.