Contextual #logging with log4j2: How we Nailed it in Project-X
▻https://hackernoon.com/contextual-logging-with-log4j2-how-we-nailed-it-in-project-x-1ffbd9e50ee
To know an object is to lead to it through a context which the world provides.— William James (1842–1910)Logging — maintaining a temporal trace of operations — is vital for any mission-critical system, no matter how big or small. Same was the case with our Project-X framework, which is why we wanted to get it right, right from the beginning.Contextual logging — where each log line automatically records its originating logical context, such as whether it came from a specific unit or from the base framework — was something we have been looking forward to, based on our experience with logging on the legendary UltraESB.We already knew log4j2 was offering contextual logging with its CloseableThreadContext implementation, with almost everything that we need; but we needed more:We needed a proper log code (...)