Lasagna-Love-Portal / bechamel-api

Bechamel: a REST API for Lasagna Love request, requester and volunteer management
Eclipse Public License 2.0
5 stars 4 forks source link

Internal logging component for generalized logging of errors & information #6

Open mattkuznicki-ll opened 1 year ago

mattkuznicki-ll commented 1 year ago

We want to be able to log errors, warnings, informational notices and API access information in Bechamel and possibly the services that Bechamel will rely on. Best may be to have a generalized component with one common place to control where and how logs are written.

mkantzer commented 1 year ago

In general, this can be approached by having main.go init the logger, and then passing it to components via dependency injection.

I also have a strong preference for structured logging over fmt.Println(), ideally shipped as JSON in prod.