I was planning on logging a lot of different stuff in my production environment,
ID: 643367 • Letter: I
Question
I was planning on logging a lot of different stuff in my production environment, things like when a user:
Logs In, Logs Off
Change Profile
Edit Account settings
Change password ... etc
Is this a good practice to do on a production enviornment? Also what is a good way to log all this. I am currently using the following code block to log to:
public void LogMessageToFile(string msg)
{
System.IO.StreamWriter sw = System.IO.File.AppendText(
GetTempPath() + @"MyLogFile.txt");
try
{
string logLine = System.String.Format(
"{0:G}: {1}.", System.DateTime.Now, msg);
sw.WriteLine(logLine);
}
finally
{
sw.Close();
}
}
Will this be ok for production? My application is very new so im not expecting millions of users right away or anything, looking for the best practices to keeping track of actions on a website or if its even best practice to.
Explanation / Answer
This is not a direct answer to the question, more of an expansion on it.
When you launch a new app I recommend logging everything the user does: log in, log out, scratches their a**, everything. If it's web-based, consider using heat maps so you know what their mouse was doing.
When I was on the BravoX project at Xerox in the late 70's we recorded pixel-by-pixel mouse movements to figure out how users might use this weird thing called a WYSIWYG editor. We would watch playbacks of user sessions during lunch. It was extremely instructive. We discovered a use pattern we called Charlie Browning
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.