-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.rb
executable file
·44 lines (38 loc) · 866 Bytes
/
main.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env ruby
# The Ruby Syslog Server
#
# Author:: Jonathan Gnagy (mailto:[email protected])
# Copyright:: Copyright (c) 2010
# License:: Distributed under the GPLv3 ( http://www.gnu.org/licenses/gpl.html )
#
# Usage:
# #!/usr/bin/env ruby
# require 'parser'
# require 'storage'
# require 'server'
# require 'yaml'
#
# config = YAML.load_file('config.yaml')
#
# server = RubySyslog::Server.new(config)
# server.start
#
# while !server.stopped? or server.logs_queued? do
# sleep(1)
# server.process_logs
# end
#
# server.shutdown
require 'parser'
require 'storage'
require 'server'
require 'yaml'
config = YAML.load_file('config.yaml')
server = RubySyslog::Server.new(config)
#server.audit = true
server.start
while !server.stopped? or server.logs_queued? do
sleep(1)
server.process_logs
end
server.shutdown