keystonejs / keystone

The most powerful headless CMS for Node.js — built with GraphQL and React
https://keystonejs.com
MIT License
8.98k stars 1.13k forks source link

Attempt to add a logger to context #9131

Closed iamandrewluca closed 2 months ago

codesandbox-ci[bot] commented 2 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 359349815ef2ba7b1e6af6166c45ac431a7b4ec4:

Sandbox Source
@keystone-6/sandbox Configuration
iamandrewluca commented 2 months ago

I just like to waste time like this ))

No point in passing something through from config to context. Just import it directly.

This makes sense, only if the user wants to customise where the logs that KS does go.

I may reopen the MR later 🤔

dcousens commented 2 months ago

@iamandrewluca this isn't a waste of time! I have personally written many different types of "logging" for Keystone 6, but nothing has landed as of yet in respect to an abstraction I am happy to push upstream. The requirements vary significantly between projects.

Maybe you could document what your needs are and we can collaborate on that?

iamandrewluca commented 1 month ago

@dcousens We mainly needed to log different sensitive actions in custom mutations, and we created a global Winston logger instance.