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

Windows Technology Windows Technology
15 Seconds
ASP 101
ASP Wire
VB Forums
VB Wire
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an site
ASP 101 is an site
Internet News
Small Business
Personal Technology

Corporate Info
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

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:

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback
The Network for Technology Professionals



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