Some example outputs for the documentation #36
Labels
documentation
Improvements or additions to documentation
user support
Someone needs help with using the library
Uh oh!
There was an error while loading. Please reload this page.
Context: I am looking to migrate our internal logging utility that was based on <2.0.7 to 3.x. I initially wanted to request some example outputs, but as I continued to read the docs, I wrote down more questions that I couldn't (immediately) answer by reading them.
First of all, thanks for continuing development & maintenance of this library.
In the entire documentation, there is only a single example currently where the output of python-json-logger is mentioned: On the landing page. It would be nice to see the outcomes of some of the examples directly in the docs to get a better understanding of what the various options and usage patterns result in. Especially the examples for
defaults
andstatic_fields
on the Quick Start page could use some expected result examples to better explain their behavior on the emitted log message.On that topic, I'd also be interested in the exact interactions of
static_fields
withdefaults
and per-recordextras
, because unlessextra
is forbidden from overridingstatic_fields
, I don't see a difference betweendefaults
andstatic_fields
currently.rename_fields
might make a difference here, but I don't see the use case for that either if all parameters can be fully controlled by the user.Furthermore, the docs example for "Default Fields" uses
extras
for the log record argument where I believe it should beextra
, but I have not verified that.We use
add_fields
to override the emitted log fields for each record, e.g. to add a severity level and a timestamp. I suspect this to be a quite common use case for the JSON formatter, so it should be added to the Cookbok page imo.Finally, a migration guide when coming from version <3.0.0 would be neat, though since the old API was basically maintained, probably not necessary.
The text was updated successfully, but these errors were encountered: