2015-01-13 10:00 GMT-03:00 Atlas <erde@chello.at>:
It's all a matter of viewpoint, that's why we should include as many of them possible :)
But, even though the answer was not directed as me, I'd like to step in:
Log4J does a good job of what I would consider the laymen spirit of logging production > he default event logging done captures the specific of class, line number, timestamp, method et als.
A dog's breakfast actually.
Strings lack self-description and this causes many unnecessary architectural problems.
As Doru already pointed out, you have to write parsers and analysers to interpret the output. And since might be many different formats for the same thing (dialects), you lose uniformity and have to handle all corner cases.
That depends in what you want to interpret. A log entry format is something you invent for your system. For log analysis you don't usually write a parser, you can just grep over the output to see why things didn't worked. Or you may use one of the tools for output analysis.
Worse yet, there is the implicit assumption that the software (or human) inspecting the log has to understand all formats, i.e. has to have knowledge about: What the names of the classes and methods mean, which subsystems (MQ, databases) are in use and how their communication protocols look like etc. And that does not factor in possible format changes or versions of subsystems.
It's hard to write generic browsers and analysers (the automated tooling Doru pointed out) that way. Also, there is the problem of reusing these parsers and analyers and code duplication, maintenance issues etc.
You don't *have to* write tools and parsers to do log analysis.
With that said, ultimately, it depends on the use cases.* For a fixed set * of inspection use cases, this logging strategy might work fine. But it certainly lacks the real flexibility to make a system more accessible and to adopt the generated information to the person and it's needs and viewpoints. You cannot address that easily with Log4j (or any logging facility for that matter). As for Log4j and its 7 levels of logging: Why not 8, 9 or a 100? What does INFO really mean? To whom? It all depends on the context.
Exactly, you define the meaning of INFO for your system. There should not be just one conception of INFO.