A
Alokai14mo ago
Lifka

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:
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.
Jump to solution
2 Replies
Solution
skirianov
skirianov14mo ago
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.
Lifka
LifkaOP14mo ago
Thanks, it works using the extension hooks !
Want results from more Discord servers?
Add your server