vuestorefront/vue-storefront

Logger improvements

Closed this issue · 1 comments

By default, debug messages are not shown in Nuxt (only info and higher), but adding DEBUG=* env variable fixed that. Following command adds DEBUG=* env variable, but excludes messages from namespaces that are irrelevant:

DEBUG=,-babel,-express:,-connect:,-send,-follow-redirects,-body-parser:,-babel:* yarn dev:ct

However, Server Middleware doesn’t use a logger created by the Nuxt.js plugin, so any configuration is ignored. This makes it impossible to log debug and info level messages.

We can replace the current logger implementation with a server-only logger like Winston. Currently, we use our logger only in a few places in the theme (and composables), and we could instead use console.xxx.

Using Winston would fix the above issues and provide a lot of new functionalities. For example, Winston provides Transports for logging to console and files, but custom or community-made integrations can be used to connect with various logging services.

Issue is closed. Reason: Too Old (>6 months)


Sergii Kirianov

Developer Advocate

Vue Storefront