Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Developer
Posts: 32
Registered: ‎08-26-2008
My Device: Not Specified
Accepted Solution

How to log Exceptions with EventLogger.logEvent(long guid, byte[] data, int level) ?

I see in the EventLogger class there is a VIEWER_EXCEPTION that interprets an event's byte[] as a stack trace. How do I log this in the first place? Say I catch a Throwable, and want to save the trace somewhere. I would need to convert an Exception to a byte[].

 

Thanks!

Developer
Posts: 31
Registered: ‎07-22-2008
My Device: Not Specified

Re: How to log Exceptions with EventLogger.logEvent(long guid, byte[] data, int level) ?

Hi,

 

It would probably behoove you to read through the net.rim.device.api.system.EventLogger docs carefully.  Particularly

- the sample code included

- "Any time you catch a Throwable object, a message is automatically logged."  Literally, if you try {blah} catch (Throwable t) {} it will log a message under the category "Java Exception"

 

http://www.blackberry.com/developers/docs/4.3.0api/net/rim/device/api/system/EventLogger.html

 

Jimmy

Developer
Posts: 31
Registered: ‎07-22-2008
My Device: Not Specified

Re: How to log Exceptions with EventLogger.logEvent(long guid, byte[] data, int level) ?

[ Edited ]
[removed accidental dup message]
Message Edited by jjthrash on 10-29-2008 09:21 AM
Developer
Posts: 32
Registered: ‎08-26-2008
My Device: Not Specified

Re: How to log Exceptions with EventLogger.logEvent(long guid, byte[] data, int level) ?

Thanks, I missed that key line.