-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include run ID in all log rows caused by the run #569
Comments
That's probably a bit hard to get done for log statements that come from third-parties (like the one you quoted, which comes from ORT core, which knows nothing about ORT server run IDs). |
Do ORT Server and ORT core use the same logging library? If so, I wonder if it has an ability to add trace IDs somehow to be used for all calls no matter the depths - some log libraries with other languages I've used have that kind of ability. If they both happen to use log4j, maybe something like this could work? ... though that's likely not automatically transferred to different services over the network. |
The problem with MDC is that it attaches the context to threads using Java's ThreadLocal and it isn't clear if that plays well with coroutines. It's something that needs to be tested but no one had time for that so far. At least Ktor seems to support MDC so maybe it works: https://ktor.io/docs/server-call-logging.html#mdc |
Both use logback, which has its own Mapped Diagnostic Context (MDC) docs. |
Great! I think some work would also be needed to transmit the MDC over all the communication methods, at least the transporters, like RabbitMQ and Kubernetes Jobs. Do the services make HTTP calls between them, or do they communicate purely through the transports? |
Log rows like
2024-07-02 11:12:48.824 [pool-1-thread-4] level=INFO org.ossreviewtoolkit.evaluator.Rule - Rule skipped.
would be much more useful if logging always printed the run ID.The text was updated successfully, but these errors were encountered: