In a large application logging is essential, but when many developers work on the code, the logs can become chaotic. One might write:
log.info("Loaded " + rowCount + " recodrs from the database.");
Another might do something like:
log.debug("Records read={}", rowCount);
A third developer might think this is the proper way:
log.trace("Record(s) read: " + NumberFormat.getInstance().format(rowCount)
+ ", values: " + values);
This will result in logs that are hard to read, and much harder to parse.
What guidance can you give developers to produce logs that have a chance to be consistent, and actually be usable by other people? Will a policy about logging do any good? And if so, what should it include? Should there be an API (above the logging framework's own) to enforce this policy?
I'm also curious about how to make the code look alike, but the more important question is about the actual output.