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

Logging improvements #15

Open
5 tasks
aantron opened this issue Apr 8, 2021 · 4 comments
Open
5 tasks

Logging improvements #15

aantron opened this issue Apr 8, 2021 · 4 comments

Comments

@aantron
Copy link
Owner

aantron commented Apr 8, 2021

  • Setting different levels for sub-logs.
  • Neat multi-line logging.
  • Log JSON, or write the whole log as JSON? This depends on JSON improvements.
  • Log-anything.
  • Document how to log to file or in real deployments.

See Logging.

@aantron aantron changed the title Setting different log levels for sub-logs Logging improvements Apr 8, 2021
@shonfeder
Copy link

Perhaps this goes here: I can't see any clear way of logging to a file (outside of redirecting stderr). Adding support for this, or documenting the expectations around how this would be achieved (even if redirecting stderr is the expected way) would be helpful!

@aantron
Copy link
Owner Author

aantron commented May 10, 2021

@shonfeder Agreed. In the last few days, Dream has gotten 4 deployment setups, all of which handle logs, and give a log-viewing command. I haven't yet had a chance to "surface" them properly, but will do so soon. The systemd and Docker setups log to journald in production (on Ubuntu and similar systems). The Heroku setup logs to Heroku's logs, of course :) In all cases, though, the surrounding deployment "system" abstracts away the true log destination, and expects to capture stderr from the various processes it manages, some of which are OCaml programs running Dream. Could you describe a scenario in which you would log to file at the Dream level?

@shonfeder
Copy link

Oh I think those deployment setups are sufficient!

Since the docs call out the use of Logs, and since it's easy to configure Logs to log to multiple reporters, it might be worth noting in the docs that this kind of configuration isn't supported and that all persistent logging is meant to read from stderr? Or maybe not. Perhaps that'd be obvious to other readers, and in any case this exchange will server as a discoverable record :)

For my purposes, the deployment documentation is excellent and fully satisfying. Thank you!

@cemerick
Copy link

cemerick commented Apr 25, 2023

@aantron In logs.ml, the top comment says:

Among other things, this module wraps the Logs library so as to prepend request ids to log messages.

Can you expand on what other things the Logs library wrapper is intended to address? I need to add support for a custom logs reporter (to enable structured logging as expected by most cloud logging platforms), and it would be helpful to understand the full intent behind the logging wrapper.

(As a bonus, a custom reporter facility would make implementing #1 super easy 😜)

tchibanda24 pushed a commit to tchibanda24/dream that referenced this issue Feb 5, 2025
Add a CoHTTP Client compatible layer and a let's encrypt provider
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

3 participants