File tree Expand file tree Collapse file tree 1 file changed +19
-7
lines changed
Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -39,15 +39,27 @@ class Engine < ::Rails::Engine
3939 end
4040 end
4141
42- def set_console_logs logger
43- # Handle the stdout logs from Action Controller
44- ActionController ::Base . logger = logger
42+ def set_console_logs new_logger
43+ if Gem ::Version . new ( Rails ::VERSION ::STRING ) >= Gem ::Version . new ( '6.0' )
44+ ActiveSupport . on_load ( :action_controller_base ) do
45+ logger = new_logger
46+ end
47+ ActiveSupport . on_load ( :action_view ) do
48+ logger = new_logger
49+ end
50+ ActiveSupport . on_load ( :active_record ) do
51+ logger = new_logger
52+ end
53+ else
54+ # Handle the stdout logs from Action Controller
55+ ActionController ::Base . logger = logger
4556
46- # Handle the stdout logs from Action View
47- ActionView ::Base . logger = logger
57+ # Handle the stdout logs from Action View
58+ ActionView ::Base . logger = logger
4859
49- # Handle the stdout logs from Active Record
50- ActiveRecord ::Base . logger = logger
60+ # Handle the stdout logs from Active Record
61+ ActiveRecord ::Base . logger = logger
62+ end
5163 end
5264 end
5365
You can’t perform that action at this time.
0 commit comments