Freigeben über


Logging customized info in IIS by using AppendToLog

When we try to log HTTP request and response info of IIS, essentially, we'd like to enable IIS logging as W3C extended format. Unfortunately, IIS (at least 6), doesn't allow to log some customized items such as customized HTTP headers. That's what AppendToLog comes from.

Actually, there are two versions of AppendToLog methods. One is IIS COM API (IResponse::AppendToLog); another is ASP.NET (Response.AppendToLog). Both of them will append the string to the request uri in the log entry. Once the response is done, the log entry will be flushed to IIS log file. So developers need to define specific separator to distinguish different logging items if AppendToLog is called multiple times.

One difference between those two is that IResponse::AppendToLog explicitly says there is 80 bytes limitation, but for Response.AppendToLog, my test proves that there is no problem for 1K.

Comments

  • Anonymous
    December 03, 2008
    Our application use method Response.AppendToLog to log additional info into IIS log file. In IIS log file our info replaced by string "..." in field cs-uri-query sometimes. Where are restrictions for argument of Response.AppendToLog ?