Skip to main content
1-Visitor
January 3, 2024
Question

Loggers not showing user in Application Logs for extension

  • January 3, 2024
  • 1 reply
  • 1028 views

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

15-Moonstone
January 23, 2024

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