mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Specify log subscribers need a logger set before they can receive events
The current example code for `ActiveSupport::LogSubscriber` mysteriously fails if you're using it outside of Rails. This helps clarify a logger needs to be set first before log subscribers can process events. [ci skip]
This commit is contained in:
parent
88b91299f3
commit
171965810e
1 changed files with 3 additions and 0 deletions
|
@ -29,6 +29,9 @@ module ActiveSupport
|
|||
# subscriber, the line above should be called after your
|
||||
# <tt>ActiveRecord::LogSubscriber</tt> definition.
|
||||
#
|
||||
# A logger also needs to be set with <tt>ActiveRecord::LogSubscriber.logger=</tt>.
|
||||
# This is assigned automatically in a Rails environment.
|
||||
#
|
||||
# After configured, whenever a <tt>"sql.active_record"</tt> notification is published,
|
||||
# it will properly dispatch the event
|
||||
# (<tt>ActiveSupport::Notifications::Event</tt>) to the sql method.
|
||||
|
|
Loading…
Reference in a new issue