redwoodjs / redwood

The App Framework for Startups
https://redwoodjs.com
MIT License
17.28k stars 991 forks source link

Implement Winston for logging #827

Closed RobertBroersma closed 3 years ago

RobertBroersma commented 4 years ago

Implement Winston for some more fine-grained logging control. https://github.com/winstonjs/winston

Some messages suggested by @peterp :

@jtoar I guess logging and docs are quite intertwined. Any opinions on this or tips/suggestions for moving forward?

jtoar commented 4 years ago

@RobertBroersma Not sure experienced here. I'd add environment vars to that list, maybe? And on the web side (this might really just be the api side though?), the lifecycle methods around Cells (beforeQuery, afterQuery) sound like good logging candidates.

But I don't think you're asking for more list items :sweat_smile: so I'll do some more research and report back.

jtoar commented 4 years ago

Here is a short list of some relevant forum topics / GitHub materials

RobertBroersma commented 4 years ago

Relevant Slack conversation:

so for us internally, I want to do something like import log from '@redwoodjs/logging' // something deep in the bowels of redwood log.debug("auth-provider" header found with a value of ${provider}) and then if I do something like DEBUG= yarn rw dev I would be able to see those messages It would be great to filter them, but I think we need to determine a way to categorise the messages. like: `DEBUG=api/ yarn rw dev` but... there are better CLI tools for handling filtering of things so, maybe the important part is just categorising the messages?

Another example might be in core, with the configurations: log.debug("webpack is in production mode") / "we have rules and loaders for the following extensions" (edited) or with the babel loaders "we just imported the following services with this glob" and when I'm writing these debug logs I might want to filter them because I just want to focus on the ones in my current mental model

It would be really cool, if we can grab all those messages and pump them into the browsers console.log to have unified logging across the platforms I would imagine that they have a transport for that kind of thing And of course... then we can write some docs on how to have logs in production :P

dthyresson commented 3 years ago

RedwoodJS release v0.28 includes Logging, but with pino.

See https://redwoodjs.com/docs/logger.html#logger for details.

Closing issue.