-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
I believe it would make more sense for this to be a single log line, not 3. #5680
Comments
The default is meant to be useful for development. Many people switch to json logging in production for example. Do you have suggestions for improving the default? |
Let me think about this, I'll test a few options. |
Was anything done to fix this or was the issue just closed without being completed? |
Nothing was done, I considered this stale. |
The problem still exists? |
What problem? This is a matter of taste and opinion. If you aren't going to move the ball forward, I'm not going to do it for you; I'm fine with it as is. |
In a cluster of 80 instances, the context often gets lost as the log lines are not always kept together. It would make more sense IMHO for this to be a single log line. Ideally, it's a single log line so that the context and error message are kept together. We are also paying for Sidekiq support - is there a better channel to raise this through? |
Putting it on one line could make it unreadable, no? This logging is primarily meant for localhost development, I've always strongly urged people to use an error service in production. As I said, I'm open to suggestions for improvement but nobody followed up. Are you suggesting something as simple as replacing the three |
The best we can do right now with the current I'd suggest there are two options here:
However, I'd personally suggest we explore expanding the Ruby My general thought is we should separate logging the interface vs logging the implementation. Unfortunately the |
I really don't want to choose between a dozen "advanced, modern" logger gems. Sidekiq already has a few monkeypatches for ::Logger to add things like Context and per-thread log levels; I'm reluctant to add any more customizations. If you want more functionality, I'd suggest opening an issue with ruby-core. Maybe they are open to moving Logger to a stdlib gem where you can add functionality. I'm open to logging those three lines as one, as long as it doesn't make the development experience worse. |
While I may agree with the specific use cases, this is generally a bad idea and I suggest you remove them, because it ossifies the core Logger gem interface and makes it hard to evolve. We had a lot of trouble making a compatible logger because of the bespoke interface. Rails does the same thing, but in different ways. It would be much better to either (1) wrap the logger interface with your own specific adapter or (2) upstream those interfaces to the logger gem. |
The issue is that a LOT of Sidekiq users do this: Sidekiq.configure_server do |cfg|
cfg.logger = ::Logger.new("/my/logfile.log")
end making it hard to wrap. Logging is the #1 thing that people customize the most and it's hugely painful to maintain 100% compatibility with any change. I agree that it would be good to upstream these changes. The main one is the per-thread log level, which should be easy to upstream. I will send a PR. |
https://github.com/mperham/sidekiq/blob/8e3f8f50727914e4c74f4bb41539131d4161cfed/lib/sidekiq/config.rb#L39-L41
Logs often get combined into a log stream, and without enough context, these three lines will get lost.
We are currently providing our own error handler, but it was surprising to see the default.
The text was updated successfully, but these errors were encountered: