I am using log4j to log information. I have used a log4j.xml file for creating log files. I have given the absolute path for each log file as a param
In your class containing main method set the name of your class to some system property. In following example I used log_dir as property name.
class ABC{
public static void main(String s[]){
System.setProperty("log_dir", ABC.class.getSimpleName());
}
}
And in your log4j.xml file use log_dir property in File param's value attribute
Works like a charm