Click to See Complete Forum and Search --> : Help me with log files


binilprasad
December 5th, 2006, 03:31 AM
hi friends

i am using log4net in my project.I have created log files based on the date.the log file name is the current date.i like to get the log files created within two specified dates.

Am working on web application in ASP.NET using C#.

torrud
December 5th, 2006, 05:34 AM
Well, try to get all filenames. Then extract the date from the filename and convert to a datetime. After that you can check the date. If the date is within your date span you take the log file. If not you discard this one. So you should loop through all filenames and you have the right ones.

It is a simple algorithm. Maybe there is a better one but it should work.

binilprasad
December 8th, 2006, 01:12 AM
Thanks a lot.