KK99
KK99

Reputation: 1989

Dynamic logfile naming based on input?

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

Answers (1)

Vasyl Keretsman
Vasyl Keretsman

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

Related Questions