-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
SemanticLogger.reopen consumes 100% CPU #26
Comments
I tried to enable
unicorn.rb:
I can see that it is now logging to the log file. But how can I make rails semantic logger to log to syslog when using unicorn? |
During a re-open it just calls the Ruby built-in Syslog capability as follows: ::Syslog.open(application, @options, @facility) Suggest trying that code standalone and see if you can work out why Ruby or the the system syslog implementation is hanging when the process is forked. |
Please re-open the ticket with further information, or post questions in the gitter support channel if you are still experiencing difficulties. |
I too ran into this issue. I eventually traced it to the fact that the master will open the Syslog on the reopen method call. However, the same will be attempted with the workers, which appear to fail with
And I believe at this point, the workers are now stuck in an infinite loop attempting to start. I think the fix is to simply to check if Syslog is opened and only open if so, else do nothing. |
@slinger987 did you manage to resolve this issue?
|
Yes, the code just needs to check to see if already opened. i.e. Syslog.open unles Syslog.opened? |
I experienced this issue: reidmorrison/semantic_logger#43 where semantic logger doesn't log anything on production that is using unicorn. I saw that I needed to do this:
to make it work.
But when I tried it, the site doesn't load and I found out it's because it is using 100% cpu after I added
SemanticLogger.reopen
My
config/environments/production.rb
file also contains this:The text was updated successfully, but these errors were encountered: