I have been told to use log4j for my logging project,but before using log4j, i wanted to know what all are its disadvantages, so that i can find some solution to do away with those disadvantages.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If I would be starting a new project today I’d use SLF4J for the logging. This is a simple API which sits in between your program and the logging library that you use. Your program will use the SLF4J API, which passes the calls to the actual logging library that you plug in. You can use different logging libraries with SLF4J (for example Log4J or java.util logging), and you can switch to a different logging library without changing anything to your own source code.
There is a “native” implementation of the SLF4J API called Logback. Last year I was on a project in which we decided to switch from Log4J to Logback very late in the project, because Log4J locks logfiles and Logback does not (which means that on Windows, you can’t delete a logfile while Log4J has it open; Logback doesn’t have that problem).