Skip to content

Conversation

@jum
Copy link

@jum jum commented Jul 29, 2025

The stdlog log type is similar to the errorlog log type, but it does output to stderr and makes sure the output is formatted as JSON. This is in particular useful for environments running in docker containers, with the stderr being collected by log aggregation services like Grafana or Google Cloud logging.

  • Resolves: #

Summary

TODO

  • ...

Checklist

The stdlog log type is similar to the errorlog log type, but it does
output to stderr and makes sure the output is formatted as JSON. This is
in particular useful for environments running in docker containers, with
the stderr being collected by log aggregation services like Grafana or
Google Cloud logging.
@jum jum requested a review from a team as a code owner July 29, 2025 15:55
@jum jum requested review from nfebe, provokateurin and yemkareems and removed request for a team July 29, 2025 15:55
@kesselb
Copy link
Contributor

kesselb commented Jul 31, 2025

Why not stdout?

@jum
Copy link
Author

jum commented Jul 31, 2025

Why not stdout?

You may be right, in docker environments it does not matter if it is send to stdout or stderr. But for a very long time it has been a convention to send diagnostics to stderr and leave stdout free for I/O functions of the program in question. I like that old convention personally and send my diagnostics in all programs to stderr. If running the program manually it makes it easier to capture diagnostics.

@github-actions
Copy link
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@kesselb
Copy link
Contributor

kesselb commented Aug 13, 2025

Hi,

Thanks again for your pull request, and sorry for not following up earlier.

I had also thought about adding a logging provider for stdout a while back, since it’s much more convenient for containers, but I didn’t have the time so many thanks for picking it up.

Symfony also uses stderr (see https://symfony.com/doc/current/logging.html), so I think it’s fine to go with that. What do you think about renaming it to just stderr instead of stdlog?

I’ll try to give it a proper review and test next week.

@jum
Copy link
Author

jum commented Aug 14, 2025

Hi,

Thanks again for your pull request, and sorry for not following up earlier.

I had also thought about adding a logging provider for stdout a while back, since it’s much more convenient for containers, but I didn’t have the time so many thanks for picking it up.

Symfony also uses stderr (see https://symfony.com/doc/current/logging.html), so I think it’s fine to go with that. What do you think about renaming it to just stderr instead of stdlog?

I thought about just using plain stderr at first as well, but that would leave no clue about the format of the lines. Normally stderr is an unstructured byte stream, but we want it to conform to a format, namely lines of json records. I did thus settle with stdlog, which I liked better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants