Use the ActiveSupport::LogSubscriber pattern

Works around nil-logger scenario and is properly integrated with tagging
and request log flushing.
Default logger is ActiveRecord logger

ActiveRecord::LogSubscriber does this too.
Spec notifications being published by locking extensions
Extract log subscriber for locking extensions