logstash-input-log4j2 3.3 → 4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a661a6d6ca3ab8b8119af6dc0ede5d3977d4343e
4
- data.tar.gz: c578297e13d1ae750263659bbd2142be3ecf4219
3
+ metadata.gz: 7364d22a2a6279d3f28edefdd5c07f973f64a129
4
+ data.tar.gz: 4654b686312ff0650d641e06a3d1d671934f7e65
5
5
  SHA512:
6
- metadata.gz: f822314505321950760711fd20d195fe7cbc5d8c0fffaede6f544237fb22a864ec7beaa50b726f93ea0c84c46a0e0134caba5b8262f952216ce6213bde56e092
7
- data.tar.gz: dbccd7ff2fa7aadc4d9456e5fe9bc188e447ebb05b3591372b097e4f94ade4a3a68ae34121e9773f5f3634db156ec3a307a9a18237a185e579592c8c1f7a211b
6
+ metadata.gz: 94808ea283f38996263273a84bf62b1d1fb20ce20d625d9110eda0d06cff0b8095fa6ecee49ce64cdd50d8d4b23f23c7a6838de893b42613b5584cec35da6822
7
+ data.tar.gz: c0f0b3d96a173695343c9372337dd9c9d0ff775c5f327d67fe91ecd933860c6ae43ce8eb60f2f7ebfcd3b91be9a314dd688941d86bd98f133fef2b202bee13fe
data/.gitignore ADDED
@@ -0,0 +1,37 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+
12
+ ## Specific to RubyMotion:
13
+ .dat*
14
+ .repl_history
15
+ build/
16
+
17
+ ## Documentation cache and generated files:
18
+ /.yardoc/
19
+ /_yardoc/
20
+ /doc/
21
+ /rdoc/
22
+
23
+ ## Environment normalisation:
24
+ /.bundle/
25
+ /lib/bundler/man/
26
+
27
+ # for a library or gem, you might want to ignore these files since the code is
28
+ # intended to run in multiple environments; otherwise, check them in:
29
+ # Gemfile.lock
30
+ # .ruby-version
31
+ # .ruby-gemset
32
+
33
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
34
+ .rvmrc
35
+
36
+ # vendor files (jars)
37
+ vendor/
data/README.md CHANGED
@@ -1,19 +1,25 @@
1
- logstash-log4j2
2
- ===============
1
+ # logstash-log4j2
3
2
 
4
3
  Log4j2 plugin for logstash.
5
4
 
6
- Supported Log4J2 versions:
7
- -----
5
+ ## Supported Log4J2 versions:
8
6
  Version: 2.0 (And probably newer 2.x releases)
9
7
 
10
- Get the plugin
11
- ----
8
+ ## Get the plugin
9
+
10
+ ### Logstash 1.5+
11
+
12
+ Use the install method
13
+
14
+ ```$LS_HOME/bin/plugin install logstash-input-log4j2```
15
+
16
+ ### Logstash 1.4
17
+
12
18
  Download the latest release at: https://github.com/jurmous/logstash-log4j2/releases and unzip it.
13
19
 
14
- Setup log4j2
15
- ------------
20
+ To run the plugin you need to start logstash with the plugin path `./bin/logstash --pluginpath PATH_TO_PLUGIN -f YOUR_CONF.conf`
16
21
 
22
+ ## Setup log4j2
17
23
  Set log4j2.xml in your project
18
24
  ```xml
19
25
  <?xml version="1.0" encoding="UTF-8"?>
@@ -31,8 +37,7 @@ Set log4j2.xml in your project
31
37
  </Configuration>
32
38
  ```
33
39
 
34
- Setup logstash
35
- -----
40
+ ## Setup Logstash
36
41
 
37
42
  ```
38
43
  input {
@@ -45,9 +50,4 @@ input {
45
50
  output {
46
51
  stdout { codec => rubydebug }
47
52
  }
48
- ```
49
-
50
- Run logstash with the plugin
51
- -------------
52
-
53
- Run from your logstash install directory `./bin/logstash --pluginpath PATH_TO_PLUGIN -f YOUR_CONF.conf`
53
+ ```
data/Rakefile CHANGED
@@ -1,4 +1,6 @@
1
1
  @files=[
2
+ {'url' => "https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-core/2.1/log4j-core-2.1.jar", 'sha1' => '31823dcde108f2ea4a5801d1acc77869d7696533' },
3
+ {'url' => "https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-api/2.1/log4j-api-2.1.jar", 'sha1' => '588c32c91544d80cc706447aa2b8037230114931'}
2
4
  ]
3
5
 
4
6
  task :default do
@@ -46,14 +46,10 @@ class LogStash::Inputs::Log4j2 < LogStash::Inputs::Base
46
46
  require "jruby/serialization"
47
47
 
48
48
  begin
49
- if __FILE__ !~ /^(jar:)?file:\/\//
50
- if File.exists?(File.dirname(__FILE__)+"/log4j-api-2.0.jar")
51
- require File.dirname(__FILE__)+"/log4j-api-2.0.jar"
52
- end
53
- if File.exists?(File.dirname(__FILE__)+"/log4j-core-2.0.jar")
54
- require File.dirname(__FILE__)+"/log4j-core-2.0.jar"
55
- end
56
- end
49
+ vendor_dir = ::File.expand_path("../../../vendor/", ::File.dirname(__FILE__))
50
+ require File.join(vendor_dir, "log4j-api-2.1.jar")
51
+ require File.join(vendor_dir, "log4j-core-2.1.jar")
52
+
57
53
  Java::OrgApacheLoggingLog4jCoreImpl.const_get("Log4jLogEvent")
58
54
  rescue
59
55
  raise(LogStash::PluginLoadingError, "Log4j2 java library not loaded")
@@ -66,7 +62,7 @@ class LogStash::Inputs::Log4j2 < LogStash::Inputs::Base
66
62
  @logger.info("Log4j input")
67
63
  end # def register
68
64
 
69
- private
65
+ private
70
66
  def pretty_print_stack_trace(proxy)
71
67
  indentation = "\n\t"
72
68
  result = "#{proxy.getName}: #{proxy.getMessage.to_s}#{indentation}#{proxy.getExtendedStackTrace.to_a.join(indentation)}"
@@ -74,13 +70,13 @@ class LogStash::Inputs::Log4j2 < LogStash::Inputs::Base
74
70
  while cause
75
71
  result += "\nCaused by: #{cause.getName}: #{cause.getMessage.to_s}#{indentation}#{cause.getExtendedStackTrace.to_a.join(indentation)}"
76
72
  cause = cause.getCauseProxy
77
- end
73
+ end
78
74
  result
79
75
  end
80
76
 
81
77
  private
82
78
  def handle_socket(socket, output_queue)
83
- begin
79
+ begin
84
80
  # JRubyObjectInputStream uses JRuby class path to find the class to de-serialize to
85
81
  ois = JRubyObjectInputStream.new(java.io.BufferedInputStream.new(socket.to_inputstream))
86
82
  loop do
@@ -103,7 +99,7 @@ class LogStash::Inputs::Log4j2 < LogStash::Inputs::Base
103
99
  if log4j_obj.contextMap
104
100
  log4j_obj.contextMap.keySet.each do |key|
105
101
  event["cmap_"+key] = log4j_obj.contextMap.get(key)
106
- end
102
+ end
107
103
  end
108
104
 
109
105
  proxy = log4j_obj.getThrownProxy
@@ -111,7 +107,7 @@ class LogStash::Inputs::Log4j2 < LogStash::Inputs::Base
111
107
  event["stack_trace"] = pretty_print_stack_trace(proxy)
112
108
  end
113
109
 
114
- event["cstack"] = log4j_obj.getContextStack.to_a if log4j_obj.getContextStack
110
+ event["cstack"] = log4j_obj.getContextStack.to_a if log4j_obj.getContextStack
115
111
  output_queue << event
116
112
  end # loop do
117
113
  rescue => e
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-log4j2'
4
- s.version = '3.3'
4
+ s.version = '4.0'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "$summary"
7
7
  s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
metadata CHANGED
@@ -1,17 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-log4j2
3
3
  version: !ruby/object:Gem::Version
4
- version: '3.3'
4
+ version: '4.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jurriaan Mous
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2014-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: logstash
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - '>='
@@ -20,8 +19,9 @@ dependencies:
20
19
  - - <
21
20
  - !ruby/object:Gem::Version
22
21
  version: 2.0.0
23
- type: :runtime
22
+ name: logstash
24
23
  prerelease: false
24
+ type: :runtime
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '>='
@@ -31,41 +31,40 @@ dependencies:
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.0.0
33
33
  - !ruby/object:Gem::Dependency
34
- name: logstash-devutils
35
34
  requirement: !ruby/object:Gem::Requirement
36
35
  requirements:
37
36
  - - '>='
38
37
  - !ruby/object:Gem::Version
39
38
  version: '0'
40
- type: :development
39
+ name: logstash-devutils
41
40
  prerelease: false
41
+ type: :development
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - '>='
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
- description: This gem is a logstash plugin required to be installed on top of the
48
- Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not
49
- a stand-alone program
47
+ description: This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program
50
48
  email: jurmous@jurmo.us
51
49
  executables: []
52
50
  extensions: []
53
51
  extra_rdoc_files: []
54
52
  files:
53
+ - .gitignore
55
54
  - Gemfile
56
55
  - README.md
57
56
  - Rakefile
58
- - lib/logstash/inputs/log4j-api-2.0.jar
59
- - lib/logstash/inputs/log4j-core-2.0.jar
60
57
  - lib/logstash/inputs/log4j2.rb
61
58
  - logstash-input-log4j2.gemspec
59
+ - vendor/log4j-api-2.1.jar
60
+ - vendor/log4j-core-2.1.jar
62
61
  homepage: https://github.com/jurmous/logstash-log4j2
63
62
  licenses:
64
63
  - Apache License (2.0)
65
64
  metadata:
66
65
  logstash_plugin: 'true'
67
66
  logstash_group: input
68
- post_install_message:
67
+ post_install_message:
69
68
  rdoc_options: []
70
69
  require_paths:
71
70
  - lib
@@ -80,9 +79,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
79
  - !ruby/object:Gem::Version
81
80
  version: '0'
82
81
  requirements: []
83
- rubyforge_project:
84
- rubygems_version: 2.0.14
85
- signing_key:
82
+ rubyforge_project:
83
+ rubygems_version: 2.1.9
84
+ signing_key:
86
85
  specification_version: 4
87
86
  summary: $summary
88
87
  test_files: []
Binary file
Binary file