Replies: 1 comment
-
We add a second log file in JSON format that the Splunk Agent consumes and forwards to the SPlunk Server. This decouples Splunk from our applications in the event Splunk goes down or is overwhelmed. if !Rails.env.test? && !Rails.env.development?
SemanticLogger.add_appender(
file_name: ‘log/splunk_json.log’,
formatter: :json,
filter: -> log { log.payload.try!(:[], :action) != ‘health_check’ },
level: :info,
metrics: true
)
end It does not specifically use the Splunk formatter in the Splunk Appender. Seems to work well for us. There is no reason we cannot spin off the Splunk format code in the Splunk Appender into a separate Formatter so that instead of Try the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Is it possible to use the Splunk formatter but output to stdout instead? Looking at the code for the Splunk appenders looks like they are fairly tied to a Splunk server but I thought I would ask. If it isn't possible currently, would you be open to a splunk_stdout appender pull request?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions