-
-
Notifications
You must be signed in to change notification settings - Fork 137
Closed
Labels
Description
Environment
Provide at least:
- Ruby Version. 2.6.8
- Rails Version. 5.2.6
- Semantic Logger Version. 4.8.2
- Rails Semantic Logger Version. 4.6.1
- Rails configuration. Only need the settings related to Rails Semantic Logger and Semantic Logger.
# application.rb
config.log_tags = {
request_id: ->(request) { request.uuid }
something: 'else'
}
config.rails_semantic_logger.format = SomeFormatter.newExpected Behavior
named_tags are also applied to rake tasks, or there's a way to configure that (I have not found how to do it)
Actual Behavior
I am using semantic logger to log in json. That part is working correctly also with rake. However the log_tags are not attached and it seems that the custom formatter I use isn't used neither. I think that with rails the log_tags are evaluated once per request, and that's probably the cause for them not being used, but I was wondering what would be an appropriate solution