<div>Hi there.</div><div><br></div>I want to set the filename of the file in the appender dynamic constructed by conversionRule (ClassicConverter).<br>Because the filename is depending the %logger.<br><div>Converter:</div>
<div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if (event.getLoggerName().contains(NEGOCIO)) {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>StackTraceElement st= event.getCallerData()[0];</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>filename = st.getClassName();</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>filename = filename.substring(NEGOCIO.length());</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>int endIndex = filename.indexOf(".");</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>filename = filename.substring(0, endIndex);</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>} else {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>filename = event.getLoggerName();</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> int endIndex = filename.indexOf(".");<span class="Apple-tab-span" style="white-space:pre"> </span> </div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> filename = filename.substring(0, endIndex);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return filename;</div>
<div><br></div><div>But the ConversionRule only work for the encoder pattern tag. So how to make it work for file tag and the fileNamePattern tag.</div><div><br></div><div>I allready try with property but don't work.</div>
<div><br></div><div><br></div><br><br><br><br><br>-------------------------------------<br>Marco Sousa</div>