Correspond Log Messages to Projects

I have a dev gateway where there are multiple projects which different developers are working on. At this time one of the projects is running a script that is causing a warning message to appear every second in the Diagnostics/Logs of the gateway web interface. This is making it difficult to view my own logs on the gateway and needs to go.

The problem is, I don't know which project is calling this script. The only thing I do know is that the script causing the warning is calling system.date.hoursBetween, since the warning is:
hoursBetween function expected a 'date' first argument, but got null

Is there a way to find out which project in the gateway is causing these log entries? I know I can filter on which projects I see logs for using the MDC Filter Configuration, but I would rather not filter for each project if I don't have to.

You can temporarily set the logging level of the expressions.hoursBetween logger to error to discard the warn level messages.

Thanks, this is a good temporary solution. My greater goal however would be to ask the owner of this project to fix the script, so the corresponding warning log entries stop appearing. Unfortunately, I just don't know which project it is. Is there any way to determine which project corresponds to this log entry other than filtering with the MDC Filter Configuration?

Look at the wrapper.log file in the gateway install folder. MDC entries show in plain text there.

1 Like

The web UI will show a magnifying glass icon next to logged messages that have associated MDC keys. If you don't see those in the web UI, then the error messages being logged don't have any associated MDC context, and unfortunately for you, troubleshooting becomes more challenging.

In the Designer, you can open each project (only one at a time) and Ctrl + F to find references to the hoursBetween expression function.

1 Like

Thanks for the response. Unfortunately, I do not have access to this folder. Otherwise, this seems like it would be a good solution.

None of my log messages have magnifying glasses unfortunately. I believe I will have to simply open each project as you state and CTRL+F it. Thanks.

1 Like