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
Our initial cut of structured logging support could do with a few small refinements. Specifically, the org.springframework.boot.logging.structured.ApplicationMetadata record feels like it's a little too tied to ECS. The environment and nodeName members aren't used in Logstash.
I think we should consider changing StructuredLogFormatter so that rather than injecting an ApplicationMetadata it can have a Spring Environment injected. We could then create a ECS specific helper class that could be bound from the environment and remove the need for ApplicationMetadata entirely.
In addition, if we inject an Envionment we may be able to simplify the log configuration. Currently it's hard to configure things like StructuredLogEncoder.serviceEnvironment. With Environment support we could move this into application.properties:
Finally, we might also want to change StructuredLogFormatter so that it's not String based. We might be able to write directly to an Appendable rather than create a String that is immediately GC'd.
The text was updated successfully, but these errors were encountered:
Our initial cut of structured logging support could do with a few small refinements. Specifically, the
org.springframework.boot.logging.structured.ApplicationMetadata
record feels like it's a little too tied to ECS. Theenvironment
andnodeName
members aren't used in Logstash.I think we should consider changing
StructuredLogFormatter
so that rather than injecting anApplicationMetadata
it can have a SpringEnvironment
injected. We could then create a ECS specific helper class that could be bound from the environment and remove the need forApplicationMetadata
entirely.In addition, if we inject an
Envionment
we may be able to simplify the log configuration. Currently it's hard to configure things likeStructuredLogEncoder.serviceEnvironment
. WithEnvironment
support we could move this intoapplication.properties
:Finally, we might also want to change
StructuredLogFormatter
so that it's notString
based. We might be able to write directly to anAppendable
rather than create aString
that is immediately GC'd.The text was updated successfully, but these errors were encountered: