I was facing the same problem a few months ago. It's possible with the standard RollingFileAppender.
If, for instance you want your log files to be named :
C:\\Log\\MyTest-yyyy-mm-dd.txt, set the following parameters as follows :
- In the \"File\" parameter, put the base name you want
(here, it will be \"C:/Log/MyTest\")
- In the \"DatePattern\" parameter, put \"-yyyy-MM-dd.\\tx\\t\"
Note that you cannot simply set \".txt\" for the extension, as \"t\" is
a reserved character for the date formatting (will be transformed in \"P\"
or \"A\" depending if the corresponding time is AM or PM).
Also, if you want to have \".log\" instead of \".txt\" for your file extension, you need to specifiy it as \".lo\\g\"
Example :
!
Hoping this will help you.
Regards,
St�phane Corteel
Technical and R&D Manager
ASK sa
[EMAIL PROTECTED]
wwww.ask.be
----------------------------------------
Hi All,
I've been happily using log4net in my latest commerci! al C# .NET
windows app....great work to all involved...it makes my life a lot
easier ;)
My application relies on the RollingFileAppender for appending log
messages and rolling the log file (named \"log.txt\") on both date and
size. This is currently working very nicely. However, it has now been
requested by the powers that be that my application rolls its log
files using the naming convention
\"log.1.txt\" and \"log.yyyymmdd.txt\"
instead of
\"log.txt.1\" and \"log.txt.yyyymmdd\".
The reason being that the former is still easily opened using Notepad
due to it preserving the .txt file extension.
Can log4net currently support this behaviour or do I need to make some
changes to the RollingFileAppender class?
Thanks in advance,
--
Josh
