I downloaded Log4j version 1.2.16 today. I want to enable logging in a simple java console application. I’m looking for a ‘quick start’ tutorial or blog that allows me to perform file logging with some good code samples.
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.
The short introduction to log4j is a perfectly fine starting point for log4j.
If you’re ready to spend some money, you can buy the log4j manual.
By the way, if you’re new to logging in Java, I’d suggest the slf4j + logback combo. In my opinion, this is the best logging solution available. Slf4j is a logging “facade” and it needs an implementation underneath. Log4j and logback can be used as implementations.
Since logback is log4j’s successor and made by the same author, I’d suggest using it instead. Not only that, logback’s manual is available online and it’s free.
Since log4j’s development has more or less stalled, I’d suggest you upgrade to slf4j + logback.