log4r_auditor 0.0.4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/log4r_auditor/auditor.rb +10 -3
- data/lib/log4r_auditor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35af909e6a99beece5094266ed10dc1d02e901ae
|
4
|
+
data.tar.gz: 45a1f820b8a0586ceb5c9d7ee948dab1da71463e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a49d7fbc78b703480187aae47c3c9a798c1c7837a5d8665a0c378b7bac96911e3f9f7d49666c932ce8a785fe7f55939eb9370865b90d7c6e30797fe052bda1d
|
7
|
+
data.tar.gz: 299b7da3b4a2414d40e8453941efd9f629e432c3192fdc57a378bc5a8b77f579bf098d36236669025fd51492048daa5ee9d7f2c6b2c4ebbb144fe8244968878d
|
@@ -14,7 +14,7 @@ module Log4rAuditor
|
|
14
14
|
required_parameters = ['file_name', 'standard_stream']
|
15
15
|
required_parameters.each { |parameter| return false unless configuration.include?(parameter) }
|
16
16
|
return false if configuration['file_name'].empty?
|
17
|
-
return false unless ['stdout', 'stderr'].include?(configuration['standard_stream'])
|
17
|
+
return false unless ['stdout', 'stderr', 'none'].include?(configuration['standard_stream'])
|
18
18
|
return true
|
19
19
|
end
|
20
20
|
|
@@ -27,10 +27,17 @@ module Log4rAuditor
|
|
27
27
|
|
28
28
|
def post_configuration_setup
|
29
29
|
@log4r = Log4r::Logger.new('soar_sc')
|
30
|
-
@log4r.outputters =
|
30
|
+
@log4r.outputters = create_outputers
|
31
31
|
@log4r
|
32
32
|
end
|
33
33
|
|
34
|
+
def create_outputers
|
35
|
+
outputers = []
|
36
|
+
outputers << create_log4r_file_output if create_log4r_file_output
|
37
|
+
outputers << create_log4r_standard_stream_output if create_log4r_standard_stream_output
|
38
|
+
outputers
|
39
|
+
end
|
40
|
+
|
34
41
|
def create_log4r_file_output
|
35
42
|
logfile = Log4r::FileOutputter.new('fileOutputter', :filename => @configuration['file_name'],:trunc => false)
|
36
43
|
logfile.formatter = create_log4r_pattern
|
@@ -40,7 +47,7 @@ module Log4rAuditor
|
|
40
47
|
def create_log4r_standard_stream_output
|
41
48
|
logstdout = Log4r::Outputter.stdout if 'stdout' == @configuration['standard_stream']
|
42
49
|
logstdout = Log4r::Outputter.stderr if 'stderr' == @configuration['standard_stream']
|
43
|
-
logstdout.formatter = create_log4r_pattern
|
50
|
+
logstdout.formatter = create_log4r_pattern if logstdout
|
44
51
|
logstdout
|
45
52
|
end
|
46
53
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: log4r_auditor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Barney de Villiers
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|