Click here to Skip to main content
15,891,665 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When you configure the file name to be "test.txt" log4net will write files with names:
test.txt, test.txt.1, test.txt.2 and so on.
I need the file names in this way:
test_000001.txt, test_000002.txt, test_000003.txt and so on.
Any idea how to do that?
Posted
Comments
Steve Maier 9-May-12 14:52pm    
I got around this with the Date rollingstyle if you want to have that solution.

What you may be looking for is this[^]. It is a patch to the Rolling File Appender to preserve file extensions with static file names.
 
Share this answer
 
Comments
silviacodeproject 10-May-12 3:24am    
Thank you very much, this is exaclty what I needed
Well, I still do not have the exact solution, but it is better now.
What I did is: Use log4net.dll 1.2.11.0. Set in the config file
PreserveLogFileNameExtension value ="true".
The file names are test.txt, test.1.txt, test.2.txt and so on.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900