-
-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added enableObjectStream option #194
base: master
Are you sure you want to change the base?
Conversation
@dougwilson Could you please have a look 😄 Thanks ! |
I will after the express 4.17 release is out, as there was a premature vulnerability listed and it is our number 1 priority right now, I hope you understand. |
@dougwilson I did some digging and I've realised that a lot of people tried to make this change to Morgan but it never went out. Morgan is being used by numerous of our project and does the job, other than the fact that it emits a string that we have to parse. It would be great if we can work something out, otherwise, we might have to implement our own middleware Thanks again and looking forward to your review & opinion |
Any updates? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, still getting reports about 4.17 from users. Here is a very quick review for points to work on:
- No docs for new feature in pr
- Does not work right when buffer feature enabled
- Silently does nothing when using built in formatters. It could throw an error or at least be documented.
I hope this feedback helps while I am working on 4.17 issues in parallel.
Background
I've got a similar use case with the issue raised: #181.
I am using Morgan for a lot of my projects and I would like to be able to write an Object in a stream instead of just a string.
Reason is that I am using Winston which supports meta-data for reach-er logs. I would like to use morgan and pass an object to Winston - instead of parsing a string.
Changes
enableObjectStream
in morgan() call.customFormatFunction && stream && enableObjectStream
), we are not concatenating a\n
(newline char), hence morgan can stream an object.Any improvements/changes are welcome.
TODO:
but I'd like to get some opinions first 😄