From f50d518d3a2ef6f318dfa70127d4f2a6382c8416 Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Wed, 20 Dec 2017 11:49:00 -0500 Subject: [PATCH] Merge pull request #16550 from nimrodshn/allow_full_error_log Allow full error log (cherry picked from commit 0e33d1ddc72d3f2a35650e94d281c391e5f04cf4) https://bugzilla.redhat.com/show_bug.cgi?id=1530645 --- app/models/authentication.rb | 2 +- app/models/mixins/authentication_mixin.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/authentication.rb b/app/models/authentication.rb index 096f40a45b5..36604c161b2 100644 --- a/app/models/authentication.rb +++ b/app/models/authentication.rb @@ -92,7 +92,7 @@ def validation_successful def validation_failed(status = :unreachable, message = nil) message ||= ERRORS[status] _log.warn("[#{resource_type}] [#{resource_id}], previously valid on: #{last_valid_on}, previous status: [#{self.status}]") - update_attributes(:status => status.to_s.capitalize, :status_details => message.to_s, :last_invalid_on => Time.now.utc) + update_attributes(:status => status.to_s.capitalize, :status_details => message.to_s.truncate(200), :last_invalid_on => Time.now.utc) raise_event(status, message) end diff --git a/app/models/mixins/authentication_mixin.rb b/app/models/mixins/authentication_mixin.rb index 2bb3afeba89..dd8a10008be 100644 --- a/app/models/mixins/authentication_mixin.rb +++ b/app/models/mixins/authentication_mixin.rb @@ -334,7 +334,7 @@ def authentication_check(*args) status == :valid ? auth.validation_successful : auth.validation_failed(status, details) end - return status == :valid, details + return status == :valid, details.truncate(20_000) end def default_authentication @@ -360,9 +360,9 @@ def authentication_check_no_validation(type, options) end end - details &&= details.to_s.truncate(200) + details &&= details.to_s - _log.warn("#{header} Validation failed: #{status}, #{details}") unless status == :valid + _log.warn("#{header} Validation failed: #{status}, #{details.truncate(200)}") unless status == :valid return status, details end