I have a class in which i am using log4j to log messages. I have log messages in if and else part of the code. I need to log the messages in if{} condition to a separate log file and the else part log messages to a separate log file. For example in the below code the message inside if should be logged in log1 file and inside else message should be logged in log2 file. I am using log4J XML configuration file. May i know if this is possible using log4j?? Any help is highly appreciated. Thanks in advance.
if(id=1){
logger.info("inside if");
}else{
logger.info("inside else");
}