
Ask HN: Normalizing logs between components - hndl
This is a software design question: I have different components which do similar operations (similar, not identical) and I want to normalize the logs that each component emits so I can make diagnosing issues easier. What approach should I take?<p>One thing I have thought about is using an error code for a specific known fault and then emit a message based on the error code (think M$ error codes) - same message parameters for all components but the values differ.<p>I&#x27;m more interested in hearing how this has been addressed by HNers who have had to build this functionality in the wild. If there are references, please share.
======
brudgers
My random advice from the internet.

Prototype at the level of text output at the shell level bash/sed/gawk/grep
because:

1\. It may turn out that that's all that's needed.

2\. Making changes in one place is easier.

3\. It is more flexible when trying to figure out what should be done.

4\. It will not introduce a bug into the existing code.

5\. It will not create a dependency between the components.

6\. The shell is the appropriate level of abstraction for logs.

This might be a good question for Software Engineering on StackExchange.

Good luck.

