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

time.Duration type does not work #349

Closed
RiaanLaubscher opened this issue Jun 20, 2024 · 3 comments
Closed

time.Duration type does not work #349

RiaanLaubscher opened this issue Jun 20, 2024 · 3 comments

Comments

@RiaanLaubscher
Copy link
Contributor

We are using slog and specifically https://github.com/samber/slog-fluentd and https://github.com/samber/slog-echo for logging HTTP traces.

The latency attribute that the handler logs is of type time.Duration which works fine if we are logging to stdout but once the fluentd handler is called it fails with a ErrUnsupportedType error for this attribute. I have traced the error to this msgp package since fluentd uses it for serialization.

I think there might be a case statement missing in msgp/write_bytes.go in AppendInt() for the time.Duration type which I support for was "added" in #311.

@klauspost
Copy link
Collaborator

Could you send a PR with your proposed change and preferably a regression test?

@RiaanLaubscher
Copy link
Contributor Author

@klauspost Please see #353

@klauspost
Copy link
Collaborator

Closed via #353

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

No branches or pull requests

2 participants