PrivateconstructorConstructs a LogFields.
The admitted names, or null to admit every field.
Private ReadonlyallowedThe admitted names, or null when every field is admitted.
StaticfromReads the declaration for the current environment.
Anything carrying an optional LOG_FIELDS. Tolerates null.
The resolved allow-list.
Private StaticparseReads a comma-separated declaration.
The declaration, such as requestId,method,path.
The allow-list it describes.
Whether a context field reaches the line.
The field name.
True when the field is admitted.
Which context fields reach the log line.
Remarks
A log line carries two kinds of field, and only one of them is negotiable. Context is ambient — the request id, the method, the path, the address — repeated on every line for the span of a request, and stamped by middleware rather than chosen at the call site. Payload is what a caller passed to one log call because that call needed it. This governs the first and never the second: a field someone typed out deliberately is not noise to be filtered.
The declaration is a comma-separated list, read from
LOG_FIELDSin the environment first and the configuration surface second — the same order asLOG_LEVEL, and for the same reason. A deployment can narrow what it ingests without a rebuild.*admits everything and is the kernel default. An empty declaration admits nothing, which is not the same as leaving it unset:LOG_FIELDS=""is a deployment saying the level, the event, and the message are the whole line.Example
Author
Bayu Dwiyan Satria
Version
1.2.1
Since
1.2.1