I was investigating an issue and it seems like the lines in production.log sometimes report the wrong database.
I’ve seen this a few times before, so this is not a single incident. Here’s a good and clear example where you can see that the third line has been logged as belonging to database db3785 where it obviously is about the same request as the fourth line, which is logged as belonging to db9210.
I was unable to pinpoint the responsible code, it might be deep inside Rails, and this is probably a race condition.
v1.8.x on Unicorn.
No, we’re not using Docker, no, I don’t think that matters here, and no, I don’t expect a quick solution.
Just letting you guys know what we are seeing
This is really unsolvable with the current log format. @tgxworld is going to investigate making https://github.com/roidrage/lograge an optional (and hopefully default) log format for rails to avoid this mess and give us properly parsable log files.
Note that lograge can now be enabled via a hiddenSiteSetting.logging_provider or setting ENABLE_LOGRAGE to 1. We’ll be testing this on our servers for awhile before deciding if lograge should be the default for all Discourse users.
Hi there,
in my organization we use lograge/graylog for all of our apps and we use the JSON formatter because it just gives us a more organized way to figure out problems.
We’re implementing a forum using discourse which does provide a lograge option but uses the KeyValue formatter, which would complicate our setup.