Adding support of log middleware (similar to rewriters) that supports promises
See original GitHub issuePlease tell us about your environment:
winston
version?-
winston@2
-
winston@3
-
node -v
outputs: 10.5.0- Operating System? macOS Sierra
- Language? ES6/7
What’s the feature?
Adding support to add data to the log befora actually logging it (on the transport level).
For example, if I use 2 transport - Console
and Loggly
- the console logs might be plain showing just the log message sent to it but I might want to add some additional information to the logs being sent to Loggly. I can create an async function to retreive the stack trace (using a package like stacktrace-js
) and append it to the json being sent to Loggly.
This is just one example I believe it could help with.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
[RFC] server(less) middleware · Issue #7208 · vercel/next.js
So for the initial implementation (and incrementally working towards the implementation above) I'd start with supporting middleware in pages_document.js ...
Read more >What's new in Next.js 12
Next 12 features include performance optimization, React 18 support, middleware, and more. Let's learn how to use these new features.
Read more >How to Use Next.js Middleware
accepts a Promise parameter, and is essentially used to prevent computation from closing whilst the promise is unresolved.
Read more >http-proxy-middleware
Node.js proxying made simple. Configure proxy middleware with ease for connect, express, browser-sync and many more. Powered by the popular ...
Read more >Edge Runtime
Learn more about the supported APIs available. ... Adding AMP Components ... is based on standard Web APIs, which is used by Middleware...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is exactly what
formats
are for, but you are correct they are synchronous. Adding async support forformats
is not currently planned. If enough folks 👍 this PR then we’ll consider reopening it.Thanks for using
winston
!This is a long standing feature request tracked as https://github.com/winstonjs/winston/issues/200