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
Developer
Developer
bo
Posts: 167
Registered: ‎11-12-2008
My Device: Not Specified
Accepted Solution

EventLogger.logEvent returns false every time

I can't figure this one out.

 

EventLogger.register returns true, but immediately after this call returns false:

 

EventLogger.logEvent(GUID, "Test".getBytes())

 

Any idea why this is happening?


Thanks.

Please use plain text.
Developer
JCarty
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: EventLogger.logEvent returns false every time

[ Edited ]

You should be using:

 

logEvent(long guid, long value, int level);

Right now you are using logEvent(GUID, CODE):

 

code - a Numeric value representing the event code ( each Byte shifted accordingly ex: ('E'<<24)|('V'<<16)|('C'<<8)|('D')).

 

 

See the following link for possible levels:

 

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

 

So your code should be:

 

 

EventLogger.logEvent(GUID, "Test".getBytes(), EventLogger.DEBUG_INFO); // or whichever level you choose

 

 

Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Please use plain text.
Developer
Developer
bo
Posts: 167
Registered: ‎11-12-2008
My Device: Not Specified

Re: EventLogger.logEvent returns false every time

[ Edited ]

Suddenly started working.

 

Though I believe I was using the below method which is ok:

 

 

logEvent(long guid, byte[] data) 
          Logs an EventLogger.ALWAYS_LOG level event for an application.

 

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

 

Please use plain text.