Replies: 1 comment
-
These are the log tags we are running with Rails 6.1 and the correct hash log tags appear everywhere we see them: config.log_tags = {
request_id: :request_id,
ip: :remote_ip,
amzn_trace_id: ->(request) { request.headers["X-Amzn-Trace-ID"] },
incap_req_id: ->(request) { request.headers["INCAP-Req-ID"] }
} I will keep an eye out and see if I notice any invalid log entries. Our primary logging goes to Splunk in JSON format, so we seldom look at the text log outputs in Cloudwatch now. |
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
-
Environment
Config:
Expected Behavior
The log_tags config should result in the tags being output as a hash, containing the
:request_id
key and the value of the current request's ID. That is not happeningActual Behavior
Instead, the tags entry in the log contains
["request_id", "request_id"]
. This is the expected output for the default Rails::Rack::LoggerWhat appears to be happening is that the RailsSemanticLogger::Rack::Logger is not being used for all logging. I have added debug output in several places in both the default rails logger and the RSL logger, and I can see that the the RSL rack logger is being used in some cases -- but those cases do not have a request and so they don't output any thing for the tags -- but it is not used in others. In other places, the original Rails::Rack::Logger is being used. The result is the output you see above.
Please advise.
Beta Was this translation helpful? Give feedback.
All reactions