Reputation: 1989
My application takes an argument as input and all the other processes happen based on this argument
I would like to create log file with name based on the input parameter
Can anyone let me know how I can do this ?
I am using Log4J 1.2.17.
Upvotes: 0
Views: 113
Reputation: 2748
Copied from the log4j manual Read Configuration section
public static void main(String[] args) {
// BasicConfigurator replaced with PropertyConfigurator.
PropertyConfigurator.configure(args[0]); //args[0] path to your log4 conf file
}
Upvotes: 1