Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

runtime exceptions 1

Status
Not open for further replies.

TheDash

MIS
Joined
Mar 25, 2004
Messages
171
Location
US
Hi, I found some messages like this in syslog.log in an unix system. Is it because the exceptions were not caught in the java program?

Error(java.lang.NumberFormatException)

OR does syslog usually record such exceptions?

Please clarify. Thanks.
 
NumberFormatException is normally thrown when you try to do something like :

String value = "5.05";
int i = Integer.parseInt(value);

Whether or not these exceptions should be caught is a matter of debate - it depends what you are doing ! However, it would be normal for a program to catch runtime parsing exceptions and take appropriate action.

--------------------------------------------------
Free Database Connection Pooling Software
 
I'm not aware of a technique, to write all java exceptions to the syslog.
If you start from commandline, exceptions will be written to stderr, aka the console, as long as you don't redirect them.

If a script starts the program, it may redirect the errormessages to the syslog.
If the exception isn't caught, you would find a stacktrace in the syslog - if you only find single messages, they were caught, I guess.

Of course the softwaredeveloper might have used a logging-mechanism to log errors, and might have specified syslog.log in the code. But again, I would expect a StackTrace for uncaught exceptions.

You could try to find out which program threw the exception to find out more - I would expect it's name in the logfile or search for date/time ...

seeking a job as java-programmer in Berlin:
 
Hi!

I am a beginer "programmer" and I have to write in syslog. Can you help me?

Thanks.
Frida.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top