Monday, May 24, 2010

How to create logs in an ASP website?

public Log(string UserID, string IP)


{





string FilePath = @"C:\My Documents\My Webs\Website\Log\log.txt";


StreamWriter sw = new StreamWriter(FilePath,true);





sw.Write(UserID + " " + IP);


sw.WriteLine(" " + DateTime.Now);





sw.Flush();


sw.Close();


}

How to create logs in an ASP website?
if you meant login page...
Reply:well.. one solution would be to create your own logging system. Second, if you are using ASP.NET try log4net. It is based off of log4j which is an awesome logging framework for java applications.


No comments:

Post a Comment