reason-native-web / morph

A webframework for Reason and OCaml
https://reason-native-web.github.io/morph/
MIT License
139 stars 7 forks source link

Provide morph-logger module #25

Open baransu opened 4 years ago

baransu commented 4 years ago

It would be amazing to have some basic logging middleware available out of the box. Maybe not something fully featured like https://github.com/expressjs/morgan but basic logger middleware from https://github.com/reason-native-web/morph-hello-world-pesy-template/blob/master/library/Middleware.re would be a good start.

ulrikstrid commented 4 years ago

I like this a lot. I had a realization that the middleware logger lies a bit so we might have to add some callbacks for logging or some other way of integrating logging. But I think that a good middleware logger is something that would be really nice to have.

baransu commented 4 years ago

In general, it would be great to provide a wrapper around logs with more customization options like something more powerful than console backend. Not sure how much logs can do at its own but I imagine something like Elixir logger: https://hexdocs.pm/logger/Logger.html not especially for a server but for whole application.