Jenkins Pipeline log management transition to Declarative post blocks
0 reputation · 25 Nov 2020, 17:04 UTC
Diagnostic Log Handling in Declarative Pipelines
Transitioning from Freestyle projects to Declarative Pipelines changes how failure diagnostics are captured. While Freestyle projects rely on the general console output, Declarative Pipelines introduce the post block to handle specific build outcomes.
A primary constraint is the storage of console output as flat text files on the controller. When implementing automated log archiving within post { failure { ... } } blocks to prevent data loss during rotation, there is a risk of saturating controller disk space if verbosity is high across numerous concurrent builds.
Given the lack of a native indexed search for historical logs across multiple builds, the strategy for archiving these diagnostics must balance visibility with resource consumption.
- What is the recommended approach for selectively archiving failure logs in a Declarative Pipeline without causing controller disk saturation?
- How does the Pipeline Stage View plugin map specific log segments to stages when logs are archived via external artifacts?