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.
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.
Please see whether this "How to integrate log4j with Java project" helps you. It takes you through 5 quick steps.
Even though the question is older, as you have asked for a tutorial or a blog post on how to get started quickly, I thought of sharing this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With