ISA Server Log plugin

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I want to write a plugin for the MS ISA 2004 Server, so that I can add logs
to the local ISA Server log (in any language). How can I achieve such a
thing? Are there any samples?

Thanks
Peter
 
Hi Peter,

yes this is possible.
Write a filter and register for the SF_NOTIFY_LOG event.
If the event occur you can change the pointer in the PHTTP_FILTER_LOG pLog
structure.

DWORD CLogNotifyFilter::OnLog(CHttpFilterContext *pCtxt, PHTTP_FILTER_LOG
pLog)
{
DebugMsg("Log notification: %s\n", pLog->pszTarget);
// check if this request is for the file name and includes a gif or GIF
extension
if ( strstr (pLog->pszTarget, ".gif") || strstr (pLog->pszTarget,
".GIF") )
{
DebugMsg("Request for the GIF (or gif)\n");
// This is one way of copying empty strings to the corresponding
// log entry. Depending on the log format, empty values will be
// represented as "-" or ,,
strcpy ( (char*)pLog->pszClientHostName, "");
// another way is to just set pointers to NULL
*(char *)pLog->pszClientUserName = NULL;
*(char *)pLog->pszServerName = NULL;
*(char *)pLog->pszOperation = NULL;
*(char *)pLog->pszTarget = NULL;
*(char *)pLog->pszParameters = NULL;
}
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}

Daniel
 
Thanks for answering! Perhaps I put it wrong, but what I actually wanted is
(should be) even more easier: I don't want to edit new logs, but to create my
own and pass it to the ISA Server. Is this also possible?

thanks
Peter
 
Back
Top