Skip to content
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

Open
mmurto opened this issue Jul 2, 2024 · 5 comments
Open

Include run ID in all log rows caused by the run #569

mmurto opened this issue Jul 2, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@mmurto
Copy link
Contributor

mmurto commented Jul 2, 2024

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.

@mnonnenmacher mnonnenmacher added the enhancement New feature or request label Jul 2, 2024
@sschuberth
Copy link
Contributor

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).

@mmurto
Copy link
Contributor Author

mmurto commented Jul 2, 2024

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.

@mnonnenmacher
Copy link
Contributor

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

@sschuberth
Copy link
Contributor

sschuberth commented Jul 2, 2024

Do ORT Server and ORT core use the same logging library?

Both use logback, which has its own Mapped Diagnostic Context (MDC) docs.

@mmurto
Copy link
Contributor Author

mmurto commented Jul 2, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants