RE: ConsoleAppender and want to write some specific logs in my log file
Two questions from log4j:-
1. Like what is the use of ConsoleAppender whether I have already able to see the output on console.
2. By using FileAppender in my log4j.xml, I am able to write all logs in logfile.log . But what if I am only want to write some specific logs in my log file..
Console is a feature of your Eclipse IDE. Its a centralized place to intercept System.out and System.err streams. In a non Eclipse way of running your code you will always need to pass your logs to Any of the two streams based on the types of log. Errors go to System.err and regular logs go to System.Out.
This is exactly what ConsoleAppender does. It passes the logs to any of the two streams.