I have one query regarding logging is that for loging in my application I am using apache log4j api and I am able to log events of my application in a seprate log file , The query is that in my application let say inside catch block I normally write e.printstacktrace() which is not proper way since I want to also log my error in the custom log file and not on console , so for this inside the catch block what should I write to log the messages back to the custom log file.. please advise
catch (Exception e) {
log.logError("Error getting value.", e);
}
and also please suggest how to log other messages like warning and alert one also..!!