diff --git a/config/initializers/100-lograge.rb b/config/initializers/100-lograge.rb index 1cb98270c3d..8676e2362ed 100644 --- a/config/initializers/100-lograge.rb +++ b/config/initializers/100-lograge.rb @@ -11,7 +11,7 @@ if (Rails.env.production? && SiteSetting.logging_provider == 'lograge') || ENV[" config.lograge.custom_payload do |controller| { ip: controller.request.remote_ip, - username: controller.current_user&.username, + username: controller.try(:current_user)&.username, } end