We have an application that sends packages from one s/w to another. Each data package has a unique id.
We have following requirements
1. For each package transfer different log files should be created.
2. The log file name should be appended by unique id
3. All the logs that are generated in the transfer of each package should be written in that package specific log file.
We are open to customize the logger code-fully. We tried some tricks by creating own appenders, LoggerConfig etc but it's not giving desired output.
Following snippet gives an basic idea what we tried but not successful. All the logs are going in a single file.
* This method gets the logger for a given exchange. If the logger file already exists then it will just get it otherwise it will
* create a new logger for that exchange, add the appender for that, and return it.
public static Logger getExchangeLogger( Class CLASS_NAME )
if ( !enableExchangeLevelLogging )
return LogManager.getLogger( CLASS_NAME );