formatting

A Log4J format example

Log4J formatting FAQ: Can you share a Log4J output/logging format example?

Sure. I'll share a Java Log4J format example that I'm pretty happy with.

I've used the following Log4J logging format quite a bit lately, as I've been working on a headless Java app that can be deployed on thousands of computers, and I was looking for a good Log4J format that was easily readable by humans, and also easy to parse by computers. Here's what my Log4J output format look like these days:

Perl printf format examples (reference page)

Here's a reference page (cheat sheet) of Perl printf formatting options. Hopefully this list covers the most common printf printing options you'll run into, or will at least point you in the right direction.

Formatting strings

Here are several examples that show how to print strings (text) with Perl and printf. I'll use single quotes in all my printf examples to help demonstrate left- and right-justification.

Syndicate content