New to logstash plugins here. How do you pass the @logger reference into another class within a plugin? The example below but trying to call another class outside and logging cause a failure.
class SecondClass
@logger.warn("This line causes an error")
end
class LogStash::Filters::ExamplePlugin < LogStash::Filters::Base
...
snip
...
def callSecondClass
@logger.info("logger works within this class")
SecondClass
end
require "logstash/util/loggable"
class SecondClass
include LogStash::Util::Loggable
logger.warn("This line causes an error")
end
class LogStash::Filters::ExamplePlugin < LogStash::Filters::Base
...
snip
...
def callSecondClass
@logger.info("logger works within this class")
SecondClass
end
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.