Skip to content
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

Using winston while developing, how to flush the file transports when debug breaking #102

Open
JanFellner opened this issue Mar 30, 2022 · 1 comment

Comments

@JanFellner
Copy link

I am developing a signalling application that receives and sends messages to different entities.
While developing i have the need to debug break if unexpected behavior occurs.

Is there any possibility to let winston synchronously flush file logs to have all messages in the log right before debug breaking?

Or is the solution to implement my own file logger that drops all the log content to the file synchronously?

@wbt
Copy link
Contributor

wbt commented Apr 1, 2022

That is a great question! You might find more active answers on StackOverflow than here, but my strategy in that situation would generally be to add a console transport based on a development mode vs. production mode configuration switch. It's way easier than implementing a whole new file log, and you can probably even pipe the console to a file if you need that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants