ASP 101 - Active Server Pages 101 - Web04
The Place ASP Developers Go!



Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash



 Top ASP 101 Stories Top ASP 101 Stories
Connections, Commands, And Procedures
What is ASP?
VBScript Classes: Part 1 of N

QUICK TIP:
Cookie-less Sessions
Show All Tips >>
ASP 101 RSS Feed ASP 101 Updates


Quick Tips


Troubleshoot By Using AppendToLog

We used to use our log files for all sorts of things, but as they got too big to handle, we resigned to simply using a commercial tool to analyze them for us and give us the highlights. Well, there are times when there's information in those files that you really need and just the highlights just won't do. On the other hand, trying to find the right entries is like looking for a needle in a haystack. For occasions such as this, I occasionally use the AppendToLog method to assist in finding the appropriate entries.

For example, lets say there's an intermittent problem with a page and you want to find out something about it. Your log files can tell you how long the request took to process, the cookies sent with the request, the status codes returned, or even the bytes sent in and out. Some of this information might be invaluable in troubleshooting this problem, but how do you associate a given request with an instance of the problem? It's easy... you append some sort of unique identifier to the log file line by using the AppendToLog method of the Response object.

You can append any string under 80 characters to the entry for the current request. It can't contain commas since log files are comma delimited, but beyond that you've got free reign. You could do it only in your error handling to log additional troubleshooting information or maybe only for users from a particular IP address. It's up to you. As I mentioned above it can even be helpful to simply log anything that you wouldn't normally find in your log files (like a pet's name or even your favorite quote) just to make it easy to find the right records.

It might not solve all your problems, but at least the haystack is smaller and the needle is shiny. ;)


Previous      Show All Tips      Next

If you have a tip you would like to submit, please send it to: webmaster@asp101.com.


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers