Skip to content

Commit 4da6241

Browse files
committed
Re-open Semantic Logger appenders in Cluster mode
This missing config meant Semantic Logger was not working in prod, where we use Puma in Cluster mode. See https://logger.rocketjob.io/forking.html#puma
1 parent 3bc448b commit 4da6241

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

config/puma.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838

3939
workers worker_count
4040

41+
before_worker_boot do
42+
# Re-open appenders after forking the process
43+
SemanticLogger.reopen
44+
end
45+
4146
# Use the `preload_app!` method when specifying a `workers` number.
4247
# This directive tells Puma to first boot the application and load code
4348
# before forking the application. This takes advantage of Copy On Write
@@ -48,3 +53,5 @@
4853

4954
# Allow puma to be restarted by `bin/rails restart` command.
5055
plugin :tmp_restart
56+
57+

0 commit comments

Comments
 (0)