In my application, I want to be able to build a formatter that inherits from LogStashLogger::Formatter::Base to get its overall behavior, and also specifically want to take advantage of the customize_event functionality in that class. So I want to create a class like the following, for example:
class MyFormatter < LogStashLogger::Formatter::Base
private
def format_event(event)
# mutate event here...
"#{event.to_json}\n"
end
end
As is, this is not possible because LogStashLogger::Formatter.build_formatter does not pass in customize_event to the initializer of custom formatter classes even when they accept that keyword arg.
In my application, I want to be able to build a formatter that inherits from
LogStashLogger::Formatter::Base
to get its overall behavior, and also specifically want to take advantage of thecustomize_event
functionality in that class. So I want to create a class like the following, for example:As is, this is not possible because
LogStashLogger::Formatter.build_formatter
does not pass incustomize_event
to the initializer of custom formatter classes even when they accept that keyword arg.