Custom log file name in mule using log4j

I'm trying to change the log file name generated by mule by modifying the log4j.xml to have the appropriate appender.

Here 's a snippet from the log4j.xml

 <RollingFile name="Rolling-Async-Perf" fileName="/usr/local/mule/logs/${app_name}.log"
            filePattern="./logs/${date:yyyy-MM}/perf-%d{yyyy-MM-dd}-%i.log.gz"  immediateFlush="false">

Here's how I set the value of application_name in the class that loads the properties related for log4j.xml

System.setProperty("app_name", "AppName");

However, the file generated has the name ${app_name}.log rather than AppName.log.

Any thoughts on how I could get mule to pick up the name of the file based on the custom property in mule?


ANSWERS:


Two options are:

1) add a property in the MULE_HOME/conf/wrapper.conf file for example:

wrapper.java.additional.15=-Dapp_name=AppName

or 2) inside the Configuration element of your log4j2.xml file example here:

<Properties>
  <Property name="app_name">AppName</Property>
</Properties>


 MORE:


 ? How do I change the default location for mule application log files?
 ? Mule log is not working if i use synch and asyn in same log4 file
 ? Mule - Dynamic Path - File component
 ? Select distinct DateTime properties from List<IDictionary<string,object>> using LINQ
 ? Select distinct DateTime properties from List<IDictionary<string,object>> using LINQ
 ? Select distinct DateTime properties from List<IDictionary<string,object>> using LINQ
 ? Using LINQ, is it possible to output a dynamic object from a Select statement? If so, how?
 ? adding new properties in expando object in foreach loop
 ? Creating a select class dynamically
 ? Creating a select class dynamically