-
Notifications
You must be signed in to change notification settings - Fork 120
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
Is "sync: true" required (or should be explained) for Redis? #44
Comments
The If you're not writing tons of log messages and want to see them immediately, you probably want to set You're right that the |
I created #45 primarily for the quick testers. I see your point about leaving sync to false for long-running processes, and maybe my suggestion would impact performance for something like Rails, so I'll understand if it's not included as the default in the examples. I also proposed a "logger.close" comment at the end of the example script so people with quick jobs had an easy way to find out how to flush. |
FWIW, log rotation in a rails/unicorn environment also requires sync = true. Otherwise, the log file will not be re-opened. |
@MichaelDoyle That's interesting. Can you reference any documentation stating this? I couldn't find any. Also note that if you're using LogStashLogger with Rails, |
I find that a bit surprising. I would expect that a flush could be forced before reopening the log file. If you're using Rails, I think this deserves further research and documentation. Thanks for bringing this up! |
I found some more information from https://unicorn.bogomips.org/TUNING.html:
I was not aware of that. |
Per #75, it turns out that Unix sockets also default to |
This is now documented in the Readme. Feel free to add any more comments if any new information arises concerning sync mode. |
I love the gem, but it took me a while to figure out that I needed "sync: true" in order to send logger info to Redis. "Sync" is only mentioned once in the README by way an example for another device, so it took me a while to find it, and that was only by adding bunches of "puts foo.inspect" lines in redis.rb. I might be missing some overall pre-requisite knowledge but should this be made clearer in the documentation? Thanks!
The text was updated successfully, but these errors were encountered: