How to configure Log4j in Java program without XML or Properties File - Example

Sometimes configuring Log4j using XML or properties file looks annoying, especially if your program is not able to find them because of some classpath issues, wouldn't it be nice if you can configure and use Log4j without using any configuration file e.g. XML or properties. Well, Log4j people have thought about it and they provide a BasicConfigurator class to configure log4j programmatically, though this is not as rich as their XML and properties file version is, but it's really handy for quickly incorporating Log4j in your Java program.

تعليقات

المشاركات الشائعة من هذه المدونة

Why use Underscore in Numbers from Java? Underscore in Numeric Literals Example

3 ways to convert String to Boolean in Java? Examples

Coursera's TensorFlow: Advanced Techniques Specialization Review [2022]