Class: AchClient::Logging
- Inherits:
-
Object
- Object
- AchClient::Logging
- Defined in:
- lib/ach_client/logging/logging.rb,
lib/ach_client/logging/savon_observer.rb,
lib/ach_client/logging/log_provider_job.rb,
lib/ach_client/logging/log_providers/log_provider.rb,
lib/ach_client/logging/log_providers/null_log_provider.rb,
lib/ach_client/logging/log_providers/stdout_log_provider.rb
Overview
Base class for all things logging
Defined Under Namespace
Classes: LogProvider, LogProviderJob, NullLogProvider, SavonObserver, StdoutLogProvider
Class Method Summary collapse
-
.codec ⇒ ActiveSupport::MessageEncryptor
Creates a codec (does encryption and decryption) using the provided password and salt.
-
.decrypt_log(gibberish) ⇒ Object
Decrypt encrypted log file.
-
.log_filters ⇒ Array<String>
List of XML nodes to scrub.
-
.log_filters=(filters) ⇒ Object
Updates the log filters.
-
.log_provider ⇒ Class
Defaults to AchClient::Logging::NullLogProvider.
-
.log_provider=(log_provider) ⇒ Object
Set the log provider Must extend AchClient::Logging::LogProvider.
-
.should_use_encryption? ⇒ Boolean
Returns whether the client has enabled encryption - if both a username and salt have been provided.
Instance Method Summary collapse
-
#_log_filters ⇒ Array<String>
List of XML nodes to scrub.
-
#_log_provider_type ⇒ Class
Type of the log provider.
-
#encryption_password ⇒ String
Password to use for encrypting logs.
-
#encryption_salt ⇒ String
Salt to use for encrypting logs.
Class Method Details
.codec ⇒ ActiveSupport::MessageEncryptor
Creates a codec (does encryption and decryption) using the provided password and salt
55 56 57 58 59 60 61 |
# File 'lib/ach_client/logging/logging.rb', line 55 def self.codec ActiveSupport::MessageEncryptor.new( ActiveSupport::KeyGenerator.new( AchClient::Logging.encryption_password ).generate_key(AchClient::Logging.encryption_salt, 32) ) end |
.decrypt_log(gibberish) ⇒ Object
Decrypt encrypted log file
72 73 74 |
# File 'lib/ach_client/logging/logging.rb', line 72 def self.decrypt_log(gibberish) codec.decrypt_and_verify(gibberish) end |
.log_filters ⇒ Array<String>
Returns List of XML nodes to scrub.
42 43 44 |
# File 'lib/ach_client/logging/logging.rb', line 42 def self.log_filters self._log_filters || [] end |
.log_filters=(filters) ⇒ Object
Updates the log filters
48 49 50 |
# File 'lib/ach_client/logging/logging.rb', line 48 def self.log_filters=(filters) self._log_filters = filters end |
.log_provider ⇒ Class
Defaults to AchClient::Logging::NullLogProvider
22 23 24 |
# File 'lib/ach_client/logging/logging.rb', line 22 def self.log_provider self._log_provider_type || AchClient::Logging::NullLogProvider end |
.log_provider=(log_provider) ⇒ Object
Set the log provider Must extend AchClient::Logging::LogProvider
29 30 31 32 33 34 35 36 |
# File 'lib/ach_client/logging/logging.rb', line 29 def self.log_provider=(log_provider) if log_provider.is_a?(Class) && log_provider < AchClient::Logging::LogProvider self._log_provider_type = log_provider else raise 'Must be subclass of AchClient::Logging::LogProvider' end end |
.should_use_encryption? ⇒ Boolean
Returns whether the client has enabled encryption - if both a username and salt have been provided
66 67 68 |
# File 'lib/ach_client/logging/logging.rb', line 66 def self.should_use_encryption? encryption_password && encryption_salt end |
Instance Method Details
#_log_filters ⇒ Array<String>
Returns List of XML nodes to scrub.
39 |
# File 'lib/ach_client/logging/logging.rb', line 39 class_attribute :_log_filters |
#_log_provider_type ⇒ Class
Returns type of the log provider.
12 |
# File 'lib/ach_client/logging/logging.rb', line 12 class_attribute :_log_provider_type |
#encryption_password ⇒ String
Returns password to use for encrypting logs.
15 |
# File 'lib/ach_client/logging/logging.rb', line 15 class_attribute :encryption_password |
#encryption_salt ⇒ String
Returns salt to use for encrypting logs.
18 |
# File 'lib/ach_client/logging/logging.rb', line 18 class_attribute :encryption_salt |