LogSection クラス 1

サーバーまたはサイトのログを構成します。

構文

class LogSection : ConfigurationSection  

メソッド

次の表に、LogSection クラスによって公開されるメソッドの一覧を示します。

名前 説明
GetAllowDefinition (ConfigurationSection から継承。)
GetAllowLocation (ConfigurationSection から継承。)
RevertToParent (ConfigurationSection から継承。)
SetAllowDefinition (ConfigurationSection から継承。)
SetAllowLocation (ConfigurationSection から継承。)

プロパティ

次の表は、LogSection クラスによって公開されるプロパティの一覧です。

名前 説明
CentralBinaryLogFile サーバー上のすべてのサイトに対する集中バイナリ ログの構成を指定する、読み取り/書き込みの CentralBinaryLogFile 値。
CentralLogFileMode サーバーの集中ログ モードを指定する、読み取り/書き込みの sint32 値。 使用できる値の一覧は、後述の「注釈」セクションに示します。
CentralW3CLogFile サーバー上のすべてのサイトに対する World Wide Web コンソーシアム (W3C) 集中ログの構成を指定する、読み取り/書き込みの CentralW3CLogFile 値。
Location (ConfigurationSection から継承。)キー プロパティ。
LogInUTF8 読み取り/書き込みの boolean 値。 IIS ですべての文字列を UCS Transformation Format 8 (UTF-8) でログする場合は true。それ以外の場合は false。 既定値は、true です。 この設定は、サーバー全体ですべてのテキストモード ログに適用されます。
Path (ConfigurationSection から継承。)キー プロパティ。
SectionInformation (ConfigurationSection から継承。)

サブクラス

このクラスにはサブクラスが含まれていません。

解説

このクラスは、ApplicationHost.config の <system.applicationHost/log> セクションに対応します。

次の表に、CentralLogFileMode プロパティとして使用できる値の一覧を示します。 既定値は 0 (Site) です。

Value キーワード 説明
0 Site すべてのクライアント要求を、サーバー レベルの集中ログではなく、サイト レベルでログします。 ログ ファイルはサイトごとに生成されます。
1 CentralBinary すべてのサイトに対するすべてのクライアント要求を、サーバー上の集中バイナリ形式の 1 つのログ ファイルにログします。
2 CentralW3C すべてのサイトに対するすべてのクライアント要求を、サーバー上の W3C 集中形式の 1 つのログ ファイルにログします。

次のコード例は、CentralLogFileMode プロパティの値を表示します。 ヘルパー関数を使って列挙型の値をテキストに変換しています。

' 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  
  

継承階層

ConfigurationSection

LogSection

要件

説明
クライアント - Windows Vista 上の IIS 7.0
- Windows 7 上の IIS 7.5
- Windows 8 上の IIS 8.0
- Windows 10 上の IIS 10.0
[サーバー] - Windows Server 2008 上の IIS 7.0
- Windows Server 2008 R2 上の IIS 7.5
- Windows Server 2012 上の IIS 8.0
- Windows Server 2012 R2 上の IIS 8.5
- Windows Server 2016 上の IIS 10.0
Product - IIS 7.0、IIS 7.5、IIS 8.0、IIS 8.5、IIS 10.0
MOF ファイル WebAdministration.mof

参照

ConfigurationSection クラス
CentralBinaryLogFile クラス
CentralW3CLogFile クラス
SiteLogFile クラス