Open felixbarny opened 3 years ago
Answering tentatively for Node.js, it seems feasible that we should be able to do this. Each of the logging frameworks that we might support (winston, pino, morgan, bunyan) have their own quirks that might make complexity an issue.
See related spec for more details.
Users can set a configuration option to make APM Agents automatically re-configure logging for them. After opting into it, agents instrument the construction of log appenders (such as file or stdout appenders) and replace the default plain-text formatter (such as
PatternLayout
) with the equivalent from the ECS logger that formats the logs to ECS-compliant JSON.This is an interesting option when manually changing the logging setup of an application is not a trivial task such as when there are long dev release cycles, onboarding logs for legacy applications, or standard off-the-shelf applications. Users still have to manually configure Fleet/Filebeat to ship the logs.
This is only feasible for agents that support some kind of instrumentation. This is the result of an early feasibility check per agent:
Spec issue
Agent issues
Extend ECS logging documentation
Support replacement of plain-text formatters with ECS formatters