Hi, I am using log4j.I have created a wrapper factory around log4j so that each module in my application gets a reference to its own logger(with own destination,pattern/formatting etc).
Now the problem, I have threads running in my module.The no of threads are configurable(by tweaking an xml file). What I need is,each of this thread to log into a log file something like , threadId_logFileName.log. I saw that I ca use a property name something like filePrefix=threadId and then use it like this, log4j.appender.dest4.File=C:/logs/Predict/text/${filePrefix}Predict.log but when the number of threads is itself configurable then in that case what do i do. I don't think to hard code serveral properties like filePrefix1,filePrefix2 etc for the threads that i amgoing to have is the right way. Can somebody help me how to do it.Or is there by any chance at runtime I can add the prefix,create a new file and continue logging. Pls suggest some way of achieving this. Regards, Chetan