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

In Java SDK, How do you change the logger level?

rwondoloski
1-Newbie

In Java SDK, How do you change the logger level?

The application is sending DEBUG messages, but I want to turn these off, so I can see the more important messages.

4 REPLIES 4
supandey
19-Tanzanite
(To:rwondoloski)

Hi Robert, where are you seeing these messages, are they in the Application Log of the platform? Is this your own application or are you getting this from an external application?

You can control the logging level by choosing the appropriate level in the snippet something like this - you'll have to use this where ever you have added the logging for e.g. Services, subscriptions, etc.

Or is there a special requirement to change at the JDK level?

Hope this helps.

Sushant,

Thanks for the reply.  What I am doing is creating an SDK using the Java SDK, rather than a Thingworx service inside the tool.  The SDK is printing DEBUG level messages to the output like these...

07:57:01.013 [NettyClient-NIO-1] DEBUG c.t.c.c.e.DispatchingClientEndpoint - RESPONSE received [endpoint id: 0, duration: 1] ResponseMessage [requestId: 118, endpointId: -1, sessionId: -1, code: STATUS_SUCCESS, multipart: false, packet #: 0, total packets: 0]

07:57:06.209 [Client-EndpointMonitor-1] DEBUG c.t.c.c.e.m.CommunicationEndpointMonitorTask - CommunicationEndpoint Monitor - checking for disconnected endpoints

07:57:06.848 [Client-EndpointMonitor-2] DEBUG c.t.c.c.e.m.CommunicationEndpointMonitorTask - CommunicationEndpoint Monitor - checking for disconnected endpoints

There are so many debug messages in the output log its difficult for me to see the ones I want.  This is fine during Java development, but now I want to turn them off for production...

Thanks, Rob

supandey
19-Tanzanite
(To:rwondoloski)

Thanks for the clarification. Could you give this a try SimpleLogger (SLF4J 1.7.21 API) , I've not tested it myself but this is the logger used in ThingWorx.

BTW, which IDE are you working with?

Thanks, I'll take a look and see if I can configure this with this information!  I am using Eclipse for the development....

Rob

Announcements