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

Community email notifications are disrupted. While we are working to resolve, please check on your favorite boards regularly to keep up with your conversations and new topics.

Loggers not showing user in Application Logs for extension

bmdeshmukh18
8-Gravel

Loggers not showing user in Application Logs for extension

Hello,

 

I am developing a extension for ThingWorx application and trying to log the errors and warnings in the Application Log file using below code.

 

private static  final Logger _logger = LogUtilities.getInstance().getApplicationLogger(CG_Authenticator.class)

_logger .info("Test Info Logger message")

 

I am able to see the log messages in the Application Log, but the User column is showing as "????" in the logs. Please refer below image.

 

bmdeshmukh18_0-1704276375746.png

 

Can someone provide any inputs, what am I missing or there is any additional configuration for loggers that is needed?


Thanks & Regards,

Bhushan

1 REPLY 1

Bhushan, 

 

Thanks for posting your question. The most likely reason the user column is empty is because the user session is not yet established. You can use code like this

 

user = Resources["CurrentSessionInfo"].GetCurrentUser();
_logger.info("Test Info Logger message" + user);

 

 to get session user and print it into the log.

 

Hope this helps,

--Marek

Top Tags