onyxia-api icon indicating copy to clipboard operation
onyxia-api copied to clipboard

Add support for logging in json or other structured format

Open johnksv opened this issue 1 year ago • 2 comments

This will increase observability of the logs when using external logging explorer tools P.t. the default spring log format is used: e.g. 2024-09-17T10:32:03.991Z INFO 7 --- [ main] fr.insee.onyxia.api.Application : No active profile set, falling back to 1 default profile: "default"

Proposal, something like:

{
"timestamp": "2024-09-17T10:32:03.991Z"
"process_id": 7
"thread": "main"
"log_level": "INFO"
"logger_name": "fr.insee.onyxia.api.Application"
"message": "No active profile set, falling back to 1 default profile: \"default\"`"
}

johnksv avatar Sep 17 '24 10:09 johnksv

Hi !

I'm all in favor for this ! After doing some research, I found this : https://spring.io/blog/2024/08/23/structured-logging-in-spring-boot-3-4
Structured logging is coming to spring boot in the next version.
So I suggest we wait a few weeks (should not be long now, spring has already released 2 MC versions).

olevitt avatar Sep 20 '24 09:09 olevitt

Hi !

I'm all in favor for this ! After doing some research, I found this : https://spring.io/blog/2024/08/23/structured-logging-in-spring-boot-3-4 Structured logging is coming to spring boot in the next version. So I suggest we wait a few weeks (should not be long now, spring has already released 2 MC versions).

According to https://calendar.spring.io/ it's due to release on november 21. Hope that's okay with you @johnksv. We will make sure to implement the structured logging shortly after the release.

olevitt avatar Sep 27 '24 13:09 olevitt