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.
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
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.
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.