Skip to content

Formatter attribute exclusion set #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
arcivanov opened this issue Dec 3, 2017 · 0 comments · Fixed by #101
Closed

Formatter attribute exclusion set #100

arcivanov opened this issue Dec 3, 2017 · 0 comments · Fixed by #101

Comments

@arcivanov
Copy link
Member

arcivanov commented Dec 3, 2017

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.

related to #47

arcivanov added a commit to arcivanov/fluent-logger-python that referenced this issue Dec 4, 2017
arcivanov added a commit to arcivanov/fluent-logger-python that referenced this issue Dec 4, 2017
arcivanov added a commit to arcivanov/fluent-logger-python that referenced this issue Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant