Class: Syslogstash::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/syslogstash/config.rb

Defined Under Namespace

Classes: ConfigurationError, InvalidEnvironmentError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env, logger:) ⇒ Config

Create a new syslogstash config based on environment variables.

Examines the environment passed in, and then creates a new config object if all is well.

Parameters:

  • env (Hash)

    the set of environment variables to use.

  • logger (Logger)

    the logger to which all diagnostic and error data will be sent.

Raises:

  • (ConfigurationError)

    if any problems are detected with the environment variables found.



33
34
35
36
37
# File 'lib/syslogstash/config.rb', line 33

def initialize(env, logger:)
	@logger = logger

	parse_env(env)
end

Instance Attribute Details

#add_fieldsObject (readonly)

Returns the value of attribute add_fields.



9
10
11
# File 'lib/syslogstash/config.rb', line 9

def add_fields
  @add_fields
end

#backlog_sizeObject (readonly)

Returns the value of attribute backlog_size.



9
10
11
# File 'lib/syslogstash/config.rb', line 9

def backlog_size
  @backlog_size
end

#loggerObject (readonly)

Returns the value of attribute logger.



16
17
18
# File 'lib/syslogstash/config.rb', line 16

def logger
  @logger
end

#logstash_serverObject (readonly)

Returns the value of attribute logstash_server.



9
10
11
# File 'lib/syslogstash/config.rb', line 9

def logstash_server
  @logstash_server
end

#relay_socketsObject (readonly)

Returns the value of attribute relay_sockets.



9
10
11
# File 'lib/syslogstash/config.rb', line 9

def relay_sockets
  @relay_sockets
end

#relay_to_stdoutObject

Returns the value of attribute relay_to_stdout.



18
19
20
# File 'lib/syslogstash/config.rb', line 18

def relay_to_stdout
  @relay_to_stdout
end

#stats_serverObject (readonly)

Returns the value of attribute stats_server.



9
10
11
# File 'lib/syslogstash/config.rb', line 9

def stats_server
  @stats_server
end

#syslog_socketObject (readonly)

Returns the value of attribute syslog_socket.



9
10
11
# File 'lib/syslogstash/config.rb', line 9

def syslog_socket
  @syslog_socket
end