title | description | ms.date | ms.assetid |
---|---|---|---|
LogSection Class1 |
Describes the LogSection class and provides the class' syntax, methods, properties, remarks, an example, inheritance hierarchy, and requirements. |
10/07/2016 |
cc93d19f-64ef-2ee5-5266-93f14570d30c |
Configures the logging for a server or site.
class LogSection : ConfigurationSection
The following table lists the methods exposed by the LogSection
class.
Name | Description |
---|---|
GetAllowDefinition | (Inherited from ConfigurationSection.) |
GetAllowLocation | (Inherited from ConfigurationSection .) |
RevertToParent | (Inherited from ConfigurationSection .) |
SetAllowDefinition | (Inherited from ConfigurationSection .) |
SetAllowLocation | (Inherited from ConfigurationSection .) |
The following table lists the properties exposed by the LogSection
class.
Name | Description |
---|---|
CentralBinaryLogFile |
A read/write CentralBinaryLogFile value that specifies the configuration of centralized binary logging for all sites on a server. |
CentralLogFileMode |
A read/write sint32 value that specifies the centralized logging mode for the server. The possible values are listed later in the Remarks section. |
CentralW3CLogFile |
A read/write CentralW3CLogFile value that specifies the configuration of World Wide Web Consortium (W3C) centralized logging for all sites on a server. |
Location |
(Inherited from ConfigurationSection .) A key property. |
LogInUTF8 |
A read/write boolean value. true if IIS logs all strings in UCS Transformation Format 8 (UTF-8); otherwise, false . The default is true . This setting applies serverwide to all text-mode logging. |
Path |
(Inherited from ConfigurationSection .) A key property. |
SectionInformation |
(Inherited from ConfigurationSection .) |
This class contains no subclasses.
This class corresponds to the <system.applicationHost/log>
section in ApplicationHost.config.
The following table lists the possible values for the CentralLogFileMode
property. The default is 0 (Site
).
Value | Keyword | Description |
---|---|---|
0 | Site |
All client requests are logged at the site level, not centrally at the server level. Log files are generated per site. |
1 | CentralBinary |
All client requests for all sites are logged to a single log file in centralized binary format on the server. |
2 | CentralW3C |
All client requests for all sites are logged to a single log file in W3C centralized format on the server. |
The following code example displays the value of the CentralLogFileMode
property. A helper function translates the enumeration value to text.
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject( _
"winmgmts:root\WebAdministration")
' Get the log section.
Set oSection = oWebAdmin.Get("LogSection.Path=" & _
"'MACHINE/WEBROOT/APPHOST',Location=''")
' Display the class name of the section.
WScript.Echo "[ " & oSection.Path_.Class & " ]"
' Display the path and location.
WScript.Echo "Path: " & oSection.Path
WScript.Echo "Location: " & oSection.Location
' Display the central log file mode.
WScript.Echo "CentralLogFileMode: " & _
GetModeText(oSection.CentralLogFileMode)
' ==== GetModeText helper function. ====
Function GetModeText(intMode)
Select Case intMode
Case 0
GetModeText="Site"
Case 1
GetModeText="CentralBinary"
Case 2
GetModeText="CentralW3C"
Case Else
GetModeText="Undefined value"
End Select
End Function
LogSection
Type | Description |
---|---|
Client | - [!INCLUDEiis70] on [!INCLUDEwinvista] - [!INCLUDEiis75] on [!INCLUDEwin7] - [!INCLUDEiis80] on [!INCLUDEwin8] - [!INCLUDEiis100] on [!INCLUDEwin10] |
Server | - [!INCLUDEiis70] on [!INCLUDEwinsrv2008] - [!INCLUDEiis75] on [!INCLUDEwinsrv2008r2] - [!INCLUDEiis80] on [!INCLUDEwinsrv2012] - [!INCLUDEiis85] on [!INCLUDEwinsrv2012r2] - [!INCLUDEiis100] on [!INCLUDEwinsrv2016] |
Product | - [!INCLUDEiis70], [!INCLUDEiis75], [!INCLUDEiis80], [!INCLUDEiis85], [!INCLUDEiis100] |
MOF file | WebAdministration.mof |
ConfigurationSection Class
CentralBinaryLogFile Class
CentralW3CLogFile Class
SiteLogFile Class