|
|
|
date: Thu, 13 Apr 2006 00:53:02 -0500,
group: microsoft.public.platformsdk.internet.server.isapi-dev
back
Re: Can ISAPI redirect log file writes
If you want to virtualize a website such that it responds to multiple
virtual Host headers, then you are responsible for writing the logfile for
each virtual website -- IIS has no idea that you did this virtualization.
No, there is no API to tell IIS where to log each request.
So, you have to write an ISAPI Filter to do it yourself, and you will need
to give the process identity Write permissions to that log directory (ISAPI
Filter runs as process identity).
Hmm, it would be a nifty sample to blog about. I'll keep this in mind.
--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Jacob Arthur" <jacobats@community.nospam> wrote in message
news:et8PI6rXGHA.5012@TK2MSFTNGP05.phx.gbl...
> Here's the situation. We have currently about 100 different sites in
> IIS6's manager which are pointing to one of 2 directories. The reasoning
> behind this was that we wanted to be able to keep separate logs for each
> host header name (i.e. user1.domain.com logs to one place while
> user2.domain.com logs somewhere else). When I originally decided on this
> solution, we had about 10 sites, and it seemed easier than any other
> alternatives. The problem is that we now have 100 and are growing by
> several every month. This makes administration a pain (especially now,
> when we are relocating the sites to another server.)
>
> My question is this, would it be possible to write an ISAPI filter that
> looks at the host header of a request and writes to an appropriate
> subdirectory of the log file directory? So if the site ID was 1001, then
> a request to user1.domain.com would cause IIS to write all the logging
> information to a log file in <Logs>\W3SVC1001\user1\exMMDDYY.log. If it
> is possible, does anyone have any example code of redirecting log writes
> or perhaps links to the appropriate portions of the API that I should be
> using?
>
> Thanks,
> Jacob
>
date: Wed, 12 Apr 2006 23:32:50 -0700
author: David Wang [Msft]
Re: Can ISAPI redirect log file writes
Right, basically what I am trying to do is to be able to assign the system 2
IP addresses. Then, third-level domain names would point at one of the two
addresses. One address might aim at one product, while the other address
aimed at the other product. Then, when a request came in, the host header
would be used as a subdirectory of the log directory. So there would be a
log directory for product one and a log directory for product 2, then
subdirectories in both to represent each host header.
Since there is no API to tell IIS where to log each request, is there
anything built in that would give me access to the pre-built line IIS was
planning to write to the log file. I realize all of this information is
available within the API, just didn't know if I could get access to IIS's
copy of it to save building my own.
Jacob
"David Wang [Msft]" wrote in message
news:ukJneVsXGHA.4620@TK2MSFTNGP04.phx.gbl...
> If you want to virtualize a website such that it responds to multiple
> virtual Host headers, then you are responsible for writing the logfile for
> each virtual website -- IIS has no idea that you did this virtualization.
> No, there is no API to tell IIS where to log each request.
>
> So, you have to write an ISAPI Filter to do it yourself, and you will need
> to give the process identity Write permissions to that log directory
> (ISAPI Filter runs as process identity).
>
> Hmm, it would be a nifty sample to blog about. I'll keep this in mind.
>
> --
> //David
> IIS
> http://blogs.msdn.com/David.Wang
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> //
>
> "Jacob Arthur" <jacobats@community.nospam> wrote in message
> news:et8PI6rXGHA.5012@TK2MSFTNGP05.phx.gbl...
>> Here's the situation. We have currently about 100 different sites in
>> IIS6's manager which are pointing to one of 2 directories. The reasoning
>> behind this was that we wanted to be able to keep separate logs for each
>> host header name (i.e. user1.domain.com logs to one place while
>> user2.domain.com logs somewhere else). When I originally decided on this
>> solution, we had about 10 sites, and it seemed easier than any other
>> alternatives. The problem is that we now have 100 and are growing by
>> several every month. This makes administration a pain (especially now,
>> when we are relocating the sites to another server.)
>>
>> My question is this, would it be possible to write an ISAPI filter that
>> looks at the host header of a request and writes to an appropriate
>> subdirectory of the log file directory? So if the site ID was 1001, then
>> a request to user1.domain.com would cause IIS to write all the logging
>> information to a log file in <Logs>\W3SVC1001\user1\exMMDDYY.log. If it
>> is possible, does anyone have any example code of redirecting log writes
>> or perhaps links to the appropriate portions of the API that I should be
>> using?
>>
>> Thanks,
>> Jacob
>>
>
>
date: Thu, 13 Apr 2006 16:39:41 -0500
author: Jacob Arthur am
Re: Can ISAPI redirect log file writes
You will have to format it all yourself. There is no access to the pre-built
line from ISAPI in usermode because IIS6 doesn't even know about it.
HTTP.SYS does and it is doing the logging in kernel mode.
You can listen on SF_NOTIFY_LOG and get just about all the information you
need, then write it out in a W3C compliant log format by reading
specifications.
--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Jacob Arthur" <jacobats@community.nospam> wrote in message
news:OJR%23HL0XGHA.5012@TK2MSFTNGP05.phx.gbl...
> Right, basically what I am trying to do is to be able to assign the system
> 2 IP addresses. Then, third-level domain names would point at one of the
> two addresses. One address might aim at one product, while the other
> address aimed at the other product. Then, when a request came in, the
> host header would be used as a subdirectory of the log directory. So
> there would be a log directory for product one and a log directory for
> product 2, then subdirectories in both to represent each host header.
>
> Since there is no API to tell IIS where to log each request, is there
> anything built in that would give me access to the pre-built line IIS was
> planning to write to the log file. I realize all of this information is
> available within the API, just didn't know if I could get access to IIS's
> copy of it to save building my own.
>
> Jacob
>
>
> "David Wang [Msft]" wrote in message
> news:ukJneVsXGHA.4620@TK2MSFTNGP04.phx.gbl...
>> If you want to virtualize a website such that it responds to multiple
>> virtual Host headers, then you are responsible for writing the logfile
>> for each virtual website -- IIS has no idea that you did this
>> virtualization. No, there is no API to tell IIS where to log each
>> request.
>>
>> So, you have to write an ISAPI Filter to do it yourself, and you will
>> need to give the process identity Write permissions to that log directory
>> (ISAPI Filter runs as process identity).
>>
>> Hmm, it would be a nifty sample to blog about. I'll keep this in mind.
>>
>> --
>> //David
>> IIS
>> http://blogs.msdn.com/David.Wang
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> //
>>
>> "Jacob Arthur" <jacobats@community.nospam> wrote in message
>> news:et8PI6rXGHA.5012@TK2MSFTNGP05.phx.gbl...
>>> Here's the situation. We have currently about 100 different sites in
>>> IIS6's manager which are pointing to one of 2 directories. The
>>> reasoning behind this was that we wanted to be able to keep separate
>>> logs for each host header name (i.e. user1.domain.com logs to one place
>>> while user2.domain.com logs somewhere else). When I originally decided
>>> on this solution, we had about 10 sites, and it seemed easier than any
>>> other alternatives. The problem is that we now have 100 and are growing
>>> by several every month. This makes administration a pain (especially
>>> now, when we are relocating the sites to another server.)
>>>
>>> My question is this, would it be possible to write an ISAPI filter that
>>> looks at the host header of a request and writes to an appropriate
>>> subdirectory of the log file directory? So if the site ID was 1001,
>>> then a request to user1.domain.com would cause IIS to write all the
>>> logging information to a log file in
>>> <Logs>\W3SVC1001\user1\exMMDDYY.log. If it is possible, does anyone
>>> have any example code of redirecting log writes or perhaps links to the
>>> appropriate portions of the API that I should be using?
>>>
>>> Thanks,
>>> Jacob
>>>
>>
>>
>
>
date: Fri, 14 Apr 2006 01:16:35 -0700
author: David Wang [Msft]
|
|