Class: Contrast::Agent::Reporting::Settings::SecurityLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/contrast/agent/reporting/settings/security_logger.rb

Overview

this class will hold the security logger settings.

Instance Method Summary collapse

Constructor Details

#initializeSecurityLogger

Returns a new instance of SecurityLogger.



12
13
14
# File 'lib/contrast/agent/reporting/settings/security_logger.rb', line 12

def initialize
  @blank = true
end

Instance Method Details

#log_fileObject

Where to log the agent’s log file, if set by the user. Overridden by agent.logger.path if set in a local configuration.



50
51
52
# File 'lib/contrast/agent/reporting/settings/security_logger.rb', line 50

def log_file
  @_log_file ||= Contrast::Utils::ObjectShare::EMPTY_STRING
end

#log_file=(log_file) ⇒ Object

Set the log file

Parameters:



58
59
60
# File 'lib/contrast/agent/reporting/settings/security_logger.rb', line 58

def log_file= log_file
  @_log_file = log_file if log_file.is_a?(String)
end

#log_levelObject

The level at which the agent should log. Overridden by agent.logger.level if set in a local configuration



34
35
36
# File 'lib/contrast/agent/reporting/settings/security_logger.rb', line 34

def log_level
  @_log_level ||= Contrast::Utils::ObjectShare::EMPTY_STRING
end

#log_level=(log_level) ⇒ Object

set the log level

Parameters:



42
43
44
# File 'lib/contrast/agent/reporting/settings/security_logger.rb', line 42

def log_level= log_level
  @_log_level = log_level if log_level.is_a?(String)
end

#not_blank!Boolean

Set the state of settings

Returns:

  • (Boolean)


26
27
28
# File 'lib/contrast/agent/reporting/settings/security_logger.rb', line 26

def not_blank!
  @blank = false
end

#settings_blank?Boolean

check to see if object is being used

Returns:

  • (Boolean)


19
20
21
# File 'lib/contrast/agent/reporting/settings/security_logger.rb', line 19

def settings_blank?
  @blank
end

#syslogObject



62
63
64
# File 'lib/contrast/agent/reporting/settings/security_logger.rb', line 62

def syslog
  @_syslog ||= Contrast::Agent::Reporting::Settings::Syslog.new
end

#to_controlled_hashObject



66
67
68
69
70
71
72
# File 'lib/contrast/agent/reporting/settings/security_logger.rb', line 66

def to_controlled_hash
  {
      level: log_level,
      path: log_file,
      syslog: syslog.to_controlled_hash
  }
end