PDA

View Full Version : Programmatic access to log files


DaveWhite
08-21-2008, 12:58 AM
Is there a way to programmatically access the files within the HTTPLOG virtual directory in ASP.Net? I've tried using



string strFileName = Server.MapPath("/httplog/") + "u_ex" + DateTime.Today.AddDays(-1).ToString("yyMMdd") + ".zip";
and it returns the correct file (meaning it finds the path). However, I cannot access the files within in order to have a nightly job mail them to me.
Any suggestions as to how I would get around this?

--Dave

mjp
08-21-2008, 05:48 AM
If your site gets a lot of traffic the logs are likely going to be too large to send as email attachments through a web application. How large are the log files typically?

bruce
08-21-2008, 06:19 AM
Dave, I think a better way to do that is to create a desktop application to FTP the HTTP log to your local computer.


Bruce

DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)

Dave White
08-22-2008, 07:19 AM
Bruce, that's actually a great idea, thanks! The log files aren't that big (typically no more than a couple of megs), but I keep forgetting to download them manually. As a result I have some gaps in my data that I would prefer to aviod.


Cheers,


Dave



bruce [DASP] said...
Dave, I think a better way to do that is to create a desktop application to FTP the HTTP log to your local computer.