Software Development

How to configure Log4j to log to console

Okay, you wrote a lot of Log4j debug statements all over your codebase but do not want them to appear in QA and/or Production environment. How to do that? You need to configure Log4j by modifying log4j.xml. You could also use log4j.properties in place of log4j.xml but some advanced settings can only be set using the latter. Might as well use something that offers greater benefits.

Read More...

Software Development

How to Log to Separate Files in Log4j2

You have a batch application that reads, parses interface files (i.e., data files from other sources usually legacy systems), and inserts data into your batch application’s database. All logs are

Read More...

Software Development

How to Trace Program Flow using Log4j2

Do you not hate it to log method with “entry” and “exit” texts? Should you use “start” or “entry”? This article demonstrates how to use Log4j2 API to perform flow tracing without the need to provide texts.

Read More...

Apache Maven, Software Development

Maven – Redirect console output to file

Sometimes when working with an IDE, all the console output are not displayed. This is normal as some IDEs are with default configuration to show only the last part of the overall output which still may consists of a few hundred lines. If the output is too huge, chances are, not all lines are displayed.

Read More...