diff --git a/app/controllers/concerns/authentication.rb b/app/controllers/concerns/authentication.rb index 68e729f02..746d3cda5 100644 --- a/app/controllers/concerns/authentication.rb +++ b/app/controllers/concerns/authentication.rb @@ -59,6 +59,7 @@ module Authentication end def set_current_session(session) + logger.struct " Authorized User##{session.user.id}", authentication: { user: { id: session.user.id } } Current.session = session cookies.signed.permanent[:session_token] = { value: session.signed_id, httponly: true, same_site: :lax } end diff --git a/config/environments/development.rb b/config/environments/development.rb index b929be5c4..74836019d 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -77,4 +77,8 @@ Rails.application.configure do config.active_job.queue_adapter = :solid_queue config.solid_queue.connects_to = { database: { writing: :queue } } + + if Rails.root.join("tmp/structured-logging.txt").exist? + config.structured_logging.logger = ActiveSupport::Logger.new("log/structured-development.log") + end end