mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
Fix: do not leak ThreadContext into the system
this is fairly recent - since 7.4 (added in GH-11075) there's a risk plugins would assume ThreadContext to exist or collide the 'global' constant - usually best to import where the Java class actually gets used ... Fixes #11356
This commit is contained in:
parent
1431df892f
commit
16c085588f
2 changed files with 5 additions and 4 deletions
|
@ -8,10 +8,11 @@ require "logstash/instrument/collector"
|
|||
require "logstash/compiler"
|
||||
require "logstash/config/lir_serializer"
|
||||
|
||||
java_import org.apache.logging.log4j.ThreadContext
|
||||
|
||||
module LogStash; class JavaPipeline < JavaBasePipeline
|
||||
include LogStash::Util::Loggable
|
||||
|
||||
java_import org.apache.logging.log4j.ThreadContext
|
||||
|
||||
attr_reader \
|
||||
:worker_threads,
|
||||
:events_consumed,
|
||||
|
|
|
@ -12,11 +12,11 @@ require "logstash/instrument/collector"
|
|||
require "logstash/filter_delegator"
|
||||
require "logstash/compiler"
|
||||
|
||||
java_import org.apache.logging.log4j.ThreadContext
|
||||
|
||||
module LogStash; class BasePipeline < AbstractPipeline
|
||||
include LogStash::Util::Loggable
|
||||
|
||||
java_import org.apache.logging.log4j.ThreadContext
|
||||
|
||||
attr_reader :inputs, :filters, :outputs
|
||||
|
||||
def initialize(pipeline_config, namespaced_metric = nil, agent = nil)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue