messageFormatter doesn't seem to work (since Winston 3.0.0?)
See original GitHub issueHello,
Recently I upgraded to Winston 3.0.0 and decided to add some message formatting as well. I my old setup I never used the messageFormatter
property of winston-cloudwatch
, but now I felt a need to.
However it seems like the messageFormatter
function is never executed. No matter what I change on the logObject or what I return from the function. Even when I do a console.log
in the formatter, it never shows up.
I did notice that the whole formatting system of Winston changed quite a bit since 2.x. Maybe this had an impact on this formatter as well? Do you have a working example somewhere?
Best, Thijs
Issue Analytics
- State:
- Created 5 years ago
- Comments:19 (10 by maintainers)
Top Results From Across the Web
Winston doesn't pretty-print to console - node.js - Stack Overflow
I figured out the answer (the documentation is incorrect). If you use the constructor, and manually add transports, you can set options, ...
Read more >Bug List
getInputStream() does not work properly if an InterruptedException happens. ... [IDEA] Undo Convert To Xtend, seems to be ignored by builder, 2015-10-08.
Read more >Open Source Used In DNAC Platform Guardian - Cisco
This document contains licenses and notices for open source software used in this product.
Read more >Notices_BigFix_Lifecycle_Starter...
from the use of this NOTICES file or its contents, including without ... MIT json-buffer-3.0.0.tgz JSON parse & stringify that supports binary.
Read more >@adobe/helix-log - npm Package Health Analysis | Snyk
Logging for Helix For more information about how to use this package see README. Latest version published 1 year ago. License: Apache-2.0.
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
To have a clean implementation I think we have to move away from the obsolete inheritance model I coded ages ago and introduce the much cleaner class model. This will also allow to get rid of old practices like
utils.inherit
andwinston.Transport.call(this, options)
, and finally allow us to follow the preferred way of creating a newTransport
.One of my wildest dreams would be also to remove the horrific
setInterval
(what was I even thinking?!?), and introduce a better approach like @timdp did for his fork https://github.com/timdp/winston-aws-cloudwatch. But I’ll see about that.This won’t be immediate though and will be surely marked as winston-cloudwatch v3.0.0. I am going though the changes required to make this a reality. If you have a better idea I’m listening ^^
Hey @lazywithclass, based on your example, it looks like that’s what the ask from OP was - to be able to define a
format
once and use it for any transport (a Winston one or a WinstonCloudWatch one).I’m curious to try your example, as I’ve done something similar in the past with no success. I’ll give it another shot soon, and if I get it working, I can come back and post some code 😃