Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

feat(server): add structured logging#25

Merged
filariow merged 6 commits intokonflux-workspaces:mainfrom
filariow:slog
Mar 12, 2024
Merged

feat(server): add structured logging#25
filariow merged 6 commits intokonflux-workspaces:mainfrom
filariow:slog

Conversation

@filariow
Copy link
Member

@filariow filariow commented Mar 8, 2024

No description provided.

filariow added 3 commits March 8, 2024 18:58
Signed-off-by: Francesco Ilario <filario@redhat.com>
Signed-off-by: Francesco Ilario <filario@redhat.com>
Signed-off-by: Francesco Ilario <filario@redhat.com>
@filariow filariow changed the title introduce structured logging feat(server): add structured logging Mar 9, 2024
Copy link
Member

@sadlerap sadlerap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A thought: we already use logr over in controller/, but we're moving to slog here. Long-term, I'd prefer us to use one logging framework and stick to it across everything.

Last I looked at the documentation, logr has support for slog as a backend (they export a struct that implements Handler), so maybe that's what we use long-term?

I'll do some more research into this on Monday; I want to see what kind of logging this produces (as compared to what log spits out).

Signed-off-by: Francesco Ilario <filario@redhat.com>
Copy link
Member

@sadlerap sadlerap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, after playing around with slog a bit, I'm not opposed to using it. I rather like the API we get TBH. LGTM.

One follow-up question, however: do you know if we have any restrictions on an output format for our logs? I know in operators logs are usually in a JSON format, but I don't know if we have any requirement to do so here.

@filariow
Copy link
Member Author

One follow-up question, however: do you know if we have any restrictions on an output format for our logs? I know in operators logs are usually in a JSON format, but I don't know if we have any requirement to do so here.

As of now, I don't know which is the format we'll need to use. I'd guess JSON format.

@filariow filariow merged commit 1f79878 into konflux-workspaces:main Mar 12, 2024
@filariow filariow deleted the slog branch June 4, 2024 17:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants