I want to write log for each thread using log4j and log file name will be \"workthread..log\",first thread print log on file \"workthread-1.log\" and second thread on \"work
you could use MDC
MDC.put(key,value); --in the code
and %X{key}-- in the file name field in the log4j configuration file