No logs in production

I have a rails 8 app that does not output any logs in `logs/production.log Here is Rails.logger in production :

#<ActiveSupport::BroadcastLogger:0x0000780d88ca0388
@broadcasts=
\[#<ActiveSupport::Logger:0x0000780d87cf8de0
@default_formatter=#<Logger::Formatter:0x0000780d88ca97f8 @datetime_format=nil>,
@formatter=#<Logger::Formatter:0x0000780d88ca5928 @datetime_format=nil>,
@level=1,
@level_override={},
@logdev=
#<Logger::LogDevice:0x0000780d879dda20
@binmode=false,
@dev=#<IO:>,
@filename=nil,
@mon_data=#<Monitor:0x0000780d88ca97d0>,
@mon_data_owner_object_id=1888,
@reraise_write_errors=[ ],
@shift_age=nil,
@shift_period_suffix=nil,
@shift_size=nil,
@skip_header=false>,
@progname=nil>\],
@formatter=#<Logger::Formatter:0x0000780d88ca5928 @datetime_format=nil>,
@progname=“Broadcast”>

production.rb :

# Log to STDOUT by default

config.logger = ActiveSupport::Logger.new(STDOUT)
.tap  { |logger| logger.formatter = ::Logger::Formatter.new }
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }

# Prepend all log lines with the following tags.

config.log_tags = \[ :request_id \]

# Change to “debug” to log everything (including potentially personally-identifiable information!)

config.log_level = ENV.fetch(“RAILS_LOG_LEVEL”, “info”)

I created a new rails 8 app to be sure I was using the default settings. The guides seems to say that default behavior is to log in log/production.log

How can I log to log/production.log ?

What is your way of accessing the log/production.log ?

I ssh in the app folder and read log/production.log{.x}

I have looked into how logs where handled in my other pre existing rails app, and removing this line :

config.logger = ActiveSupport::Logger.new(STDOUT)
.tap  { |logger| logger.formatter = ::Logger::Formatter.new }
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }

Make the app output the logs in log/{env}.log

I should look into how the standard output of a rails app run through passenger run through Apache run through systemd works.