David,

I do not. I was curious because I hadn't thought of looking into it until I saw 
your email (although I've periodically had the same question but obviously 
never investigated). Where the other properties are lower-case at the first 
position you might try "preserveLogFileNameExtension".

Chris

On Sep 20, 2010, at 2:32 PM, David Gerler wrote:

> Michael,
>    Other than still having the .txt in the middle of the file name, it works 
> nicely. Well enough for our use in fact.
>  
> Chris,
>    Do you have an example of how to use it? I tried:
>  
>     <appender name="Root" type="log4net.Appender.RollingFileAppender">
>                 <file value="c:/log/synch/root.txt" />
>                 <appendToFile value="true" />
>                 <maxSizeRollBackups value="10" />
>                 <PreserveLogFileNameExtension value="true">
>                 <datePattern value="yyyy-MM-dd" />
>                 <rollingStyle value="Date" />
>                 <staticLogFileName value="true" />
>                 <layout type="log4net.Layout.PatternLayout">
>                                 <header value="[Header]&#xD;&#xA;"/>
>                                 <footer value="[Footer]&#xD;&#xA;"/>
>                                 <conversionPattern value="%date [%thread] 
> %-5level %logger (%file:%line) - %message%newline" />
>                 </layout>
>     </appender>
>  
> From: Lansdaal, Michael T [mailto:michael.t.lansd...@boeing.com] 
> Sent: Monday, September 20, 2010 1:00 PM
> To: log4net-user@logging.apache.org
> Subject: RE: Date Rollover filename
>  
> Yes - you need to set the datePattern value for the appender.  Something like 
> this
>  
> <appender name="RollingDebugLogFileAppender" 
> type="log4net.Appender.RollingFileAppender">
>    <file value="..\\Data\\Logs\\debug" />
>    <appendToFile value="true" />
>    <rollingStyle value="Composite" />
>    <staticLogFileName value="false" />
>    <datePattern value=".yyyy-MM-dd.lo\g" />
> and you would set yours to
>    <datePattern value=".yyyy-MM-dd.txt" />
> Hope this helps.
> From: David Gerler [mailto:dger...@gmail.com] 
> Sent: Monday, September 20, 2010 10:23 AM
> To: log4net-user@logging.apache.org
> Subject: Date Rollover filename
> 
> We are using the Date rollover style for our logs. The thing we don’t like is 
> the fact that it appends the date to the end of the filename like 
> “root.txt20100920”. We’d like to have it insert the date in the middle like 
> “root20100920.txt”. Is that possible?
>  
> I have searched the documentation and can’t seem to find anything. I also 
> tried inserting [%date] in the filename in the config file, but that didn’t 
> work.

Reply via email to