[This is preliminary documentation and subject to change]

# Logging Module Enumerator

###### Overview

Multiple logging modules can lead to multiple problems if you aren't prepared. This sample tool illustrates some techniques you can use to create logging management tools of your own.

This sample tool serves two separate functions. If it is invoked without command-line arguments, then it simply lists all logging modules that currently have entries in the metabase on your server. But if an ADsPath is given, such as IIS://LocalHost/W3SVC/3, then the tool will try to determine what is considered the active logging module for that metabase node, and will give you information about that logging module.

###### Code Tour

To list the available logging modules, the GetObject method is invoked to gain access to the IIS://LocalHost/Logging node of the metabase. A For ... Each loop is then used to enumerate the modules that are founded in that node.

Gathering information about a specific server's logging module is a bit more involved. Because the only property at the server level that indicates what logging module is currently in use by the server is the LogPluginClsId property, this value must be compared to each and every module listed at the //LocalHost level until a match is found.

GetObject is used to gain access to the list of logging modules provided at the //LocalHost level. The CLSID of the logging module is compared to the CLSID of each logging module provided in this main list until a match is found. When a match is found, the script tells you all it can about the logging module; if no match is found between the CLSIDs, the script aborts with an error.

###### Location

This script is available in the Internet services directory, at ...\iissamples\sdk\admin\logenum.vbs.

© 1997-2001 Microsoft Corporation. All rights reserved.