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

Web Interface logs are missing lines #77

Open
Removed-5an opened this issue Oct 1, 2015 · 3 comments
Open

Web Interface logs are missing lines #77

Removed-5an opened this issue Oct 1, 2015 · 3 comments

Comments

@Removed-5an
Copy link

Hi,

When I run my application with Guvnor and use:
guv logs myapp

I can see all lines that I expect when I would be when running my app manually.

But when looking at the logs from the web interface I see that some lines are missing and others are printed in a seemingly random way.

What's going on here?

@Removed-5an
Copy link
Author

I think it might be related due to my process being extremely CPU intensive, that might be causing the lines to not show up in the weblogs? However I had no such issues with PM2-Web...

@achingbrain
Copy link
Member

If you run your app manually and are writing to stdout or stderr via console.log or whatever, this is a synchronous blocking operation so will work as you expect. When run under guvnor the logs get sent as events from your process to the daemon.

If your app is doing a lot of very CPU intensive work it's possible you are blocking the event loop so these events will stack up and never be emitted.

If you structure your app to do discrete packets of work with promises or the async library or generators or whatever, it'll give the event loop a chance to run between chunks of work and your logs should appear as expected.

@Removed-5an
Copy link
Author

I'm using Winston as a logging library and am also logging to disk with Winston (all sync). I added a small queue between log messages of 50 ms between messages to give the event loop more chances to run. Now everything seems to appear in Guvnor. Still strange that this used to work perfectly in PM2-Web...

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