Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

[FEATURE] Use a Logger to replace console logs #570

Open
rain2o opened this issue Jun 9, 2021 · 0 comments
Open

[FEATURE] Use a Logger to replace console logs #570

rain2o opened this issue Jun 9, 2021 · 0 comments

Comments

@rain2o
Copy link
Contributor

rain2o commented Jun 9, 2021

I don't know if this repo is still accepting feature requests, or if it will ultimately be replaced by the new Storefront API, but as we're still using this one I wanted to present this idea here.

It would be very useful to add a custom Logger to be used throughout the code when logging stuff, which can have configurable controls for things like what level (if any) to log in Production. Vue Storefront has something like this already, so it should be somewhat translatable.

As a note, we recently discovered that vuestorefront-api is logging a lot of info, including the JSON encoded order data when placing an order, even in production. This was a security and privacy concern, so for now we have just removed all of these console.logs from the core code. In the short-term, something to easily configure this would be ideal, allowing us to basically disable all of these logs in a production environment.

In the long-term, it could be nice to have the option to use our own logger. Like how we now have the ability to set our own Image or Product processors for example. In our specific situation, we need to implement winston logger with a specific format so that it can be synchronized with a Kibana instance where we handle all of our log files internally. Being able to set a logger processor in the config like we can for products would make this a nice and easy change, and would allow us to set our own formatting, configuration options, etc...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant