API Logger
Hello !
I'm using the Magento middleware and I would like to log all requests from the middleware to Magento. I tried using 'express-requests-logger' but nothing is logging when using
app.use(audit())
. Do you know how I can achieve that ?Solution:Jump to solution
I think this is the case that we are constructing the client and skips middleware .use() mehtod.
you can use this extend middleware method https://docs.vuestorefront.io/middleware/guides/extensions#creating-an-extension to add logger for all requests...
Vue Storefront Docs
Extending the Middleware
When developing your storefront, there will be times when you need to customize the way the middleware and integrations run. For example, you might want to add or edit a new API endpoint or even modify the Express.js application itself. Vue Storefront's Server Middleware allows you to do this using extensions.
2 Replies
Solution
I think this is the case that we are constructing the client and skips middleware .use() mehtod.
you can use this extend middleware method https://docs.vuestorefront.io/middleware/guides/extensions#creating-an-extension to add logger for all requests
Vue Storefront Docs
Extending the Middleware
When developing your storefront, there will be times when you need to customize the way the middleware and integrations run. For example, you might want to add or edit a new API endpoint or even modify the Express.js application itself. Vue Storefront's Server Middleware allows you to do this using extensions.
Thanks, it works using the extension hooks !