cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Better logging -> easier debugging

omezger
1-Newbie

Better logging -> easier debugging

Hi,

I'm having the following error log:

Error processing local event: Execution error in service script [VM-TR3 VMHumidityHigh.DataChange] : Wrapped java.lang.Exception: Unable To Convert From java.lang.String to NUMBER Cause: Unable To Convert From java.lang.String to NUMBER

Sadly, it doesn't tell me about the line or variable that failed. Is there a way to enable a more explicit error log?

thanks

3 REPLIES 3
Aanjan
9-Granite
(To:omezger)

Olmo, you can increase the logging levels at Monitoring -> Application logs -> Settings tab. The default setting is WARN. Please do note that changing the logging levels will significantly fill up your hard drive space as more data gets logged. It is recommended to turn the log(s) back to WARN once you are done with debugging.

omezger
1-Newbie
(To:Aanjan)

For future Reference, this topic is handled in chapter 41 of the tutorial handbook: Monitoring.

jasong
1-Newbie
(To:omezger)

Another thing to do that is helpful, if you are writing your own services, is to wrap the entire service in a try catch, like this.

try {

//whatever

catch (err) {

     logger.error(me.name + "MyServiceName() Fatal Error on line " + err.lineNumber + ": " + err);

}

This way you get your thing name that was executing, the service name that threw the error, and the line number where it happened. Note that it appears this number is always off by one. If it say line 12, it's probably line 13.

Top Tags