logtail / logtail-ruby-rails

Better Stack Rails client
https://betterstack.com/logs
Other
12 stars 6 forks source link

SQL logs aren't sent to logtail when Doorkeeper is used #4

Closed sigra closed 1 year ago

sigra commented 3 years ago

Hey guys!

Trying to implement logtail to our project which is using very popular doorkeeper gem. Got one weird thing that some logs are sent to logtail but ActiveRecord logs weren't.

I didn't dig it to understand what happened but found workaround that works for us and maybe will be helpful for others who use Doorkeeper too 😃 .

So, it seems that initializers order is matter and renaming initializers/logtail.rb -> initializers/00_logtail.rb fixes the problem.

Would be perfect to get advice how to debug this and maybe I'll find time to open PR 🤓

scleriot commented 2 years ago

We had the same issue, the 00_ trick didn't fix it but adding the Logtail initalization logic directly in config/application.rb made it work with SQL logs!

heertheeswaran commented 2 years ago

Yeah adding the logic directly on the application.rb works fine

PetrHeinz commented 1 year ago

The use of initializer file is avoided in new installations: https://github.com/logtail/logtail-ruby-rails/pull/14 (gem version 0.1.8).