You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current logic behind FluentRecordFormatter is to only log the attributes that are specified with keys and values being formatted. This is too limiting as LoggerAdapter and extra fields allow the same formatter to be used with different sets of extra fields, all of which need to get transmitted to FluentD. Furthermore this logic requires to create a handler-formatter pair and add each one to distinct logger if different data set types are send from different loggers.
There are standard fields that will always occur on the LogRecord. All other firelds would be custom user-specified ones, including extra.
The solution, to my mind, is simple: provide a mode, where instead of inclusion dictionary and exclusion set is used that will filter out the fields that we don't want to send through formatter. If a exclusion dictionary is None, we assume current behavior. If exclusion dictionary is set()/[]/() we send everything. In all other cases we exclude the keys from the specified set.
The current logic behind FluentRecordFormatter is to only log the attributes that are specified with keys and values being formatted. This is too limiting as LoggerAdapter and extra fields allow the same formatter to be used with different sets of extra fields, all of which need to get transmitted to FluentD. Furthermore this logic requires to create a handler-formatter pair and add each one to distinct logger if different data set types are send from different loggers.
There are standard fields that will always occur on the LogRecord. All other firelds would be custom user-specified ones, including extra.
The solution, to my mind, is simple: provide a mode, where instead of inclusion dictionary and exclusion set is used that will filter out the fields that we don't want to send through formatter. If a exclusion dictionary is
None
, we assume current behavior. If exclusion dictionary isset()/[]/()
we send everything. In all other cases we exclude the keys from the specified set.related to #47
The text was updated successfully, but these errors were encountered: