CentralW3CLogFile Class1
서버에서 W3C(World Wide Web Consortium) 중앙 집중식 로깅에 대한 설정을 구성합니다.
구문
class CentralW3CLogFile : EmbeddedObject
메서드
이 클래스에는 메서드가 없습니다.
속성
다음 표에서는 클래스에서 노출하는 속성을 나열합니다 CentralW3CLogFile
.
속성 | Description |
---|---|
Directory |
로그 항목을 쓸 디렉터리를 지정하는 흠 없는 읽기/쓰기 string 값입니다. 기본값은 "%SystemDrive%\inetpub\logs\LogFiles"입니다. |
Enabled |
읽기/쓰기 boolean 값입니다. true W3C 중앙 집중식 로깅을 사용하도록 설정하면 이고, 그렇지 않으면 입니다 false . 기본값은 true 입니다. |
LocalTimeRollover |
읽기/쓰기 boolean 값입니다. true 새 로그 파일이 현지 시간을 기반으로 하면 이고, false UTC(협정 세계시)를 기반으로 하는 경우 입니다. 기본값은 false 입니다. |
LogExtFileFlags |
로그 파일에 기록할 특성을 지정하는 마스크를 포함하는 읽기/쓰기 sint32 값입니다. 가능한 값은 설명 섹션의 뒷부분에 나열됩니다. |
Period |
현재 로그 파일이 닫혀 있고 새 로그 파일이 시작되는 빈도를 지정하는 읽기/쓰기 sint32 열거형입니다. 가능한 값은 설명 섹션의 뒷부분에 나열됩니다. |
TruncateSize |
로그 파일 콘텐츠를 잘라야 하는 크기를 바이트 단위로 지정하는 읽기/쓰기 string 값입니다. 이 특성은 가 로 설정된 MaxSize 경우 Period 구성해야 합니다. 크기는 1048576(1메가바이트)와 4294967295(4기가바이트) 사이여야 합니다. 기본값은 20971520(20MB)입니다. |
를 서브클래싱합니다.
이 클래스에는 하위 클래스가 없습니다.
설명
이 클래스의 인스턴스는 LogSection 클래스의 속성에 포함 CentralW3CLogFile
됩니다.
다음 표에서는 속성에 대해 가능한 값을 나열합니다 LogExtFileFlags
. 기본 특성은 ClientIP
, , Date
, HttpStatus
, HttpSubStatus
, Method
, ServerIP
, ServerPort
SiteName
, Time
, UriQuery
, UriStem
, UserAgent
, UserName
및 입니다Win32Status
.
값 | 특성 |
---|---|
1 | Date |
2 | Time |
4 | ClientIP |
8 | UserName |
16 | SiteName |
32 | ComputerName |
64 | ServerIP |
128 | Method |
256 | UriStem |
512 | UriQuery |
1024 | HttpStatus |
2048 | Win32Status |
4096 | BytesSent |
8192 | BytesRecv |
16384 | TimeTaken |
32768 | ServerPort |
65536 | UserAgent |
131072 | Cookie |
262144 | Referer |
524288 | ProtocolVersion |
1048576 | Host |
2097152 | HttpSubStatus |
다음 표에서는 속성에 대해 가능한 값을 나열합니다 Period
. 기본값은 1(Daily
)입니다.
값 | 키워드 | Description |
---|---|---|
0 | MaxSize |
로그 파일이 닫혀 있고 의 값 TruncateSize 에 도달하면 새 로그 파일이 시작됩니다. |
1 | Daily |
로그 파일이 닫혀 있고 새 로그 파일이 하루에 한 번 시작됩니다. |
2 | Weekly |
로그 파일이 닫혀 있고 새 로그 파일이 일주일에 한 번 시작됩니다. |
3 | Monthly |
로그 파일이 닫혀 있고 새 로그 파일이 매월 한 번 시작됩니다. |
4 | Hourly |
로그 파일이 닫혀 있고 새 로그 파일이 시간당 한 번 시작됩니다. |
예제
다음 코드 예제에서는 로그 파일 모드를 CentralW3C
로 설정하고, centralW3C 로깅을 사용하도록 설정하고, 속성을 MaxSize
로 설정하고Period
, 로그 파일이 현지 시간을 사용하도록 지정하고, 로그 크기를 100MB로 제한합니다. 도우미 함수는 변경 전과 후에 설정을 표시합니다.
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
' Get the log configuration section.
Set oSection = oWebAdmin.Get("LogSection.Path=" & _
"'MACHINE/WEBROOT/APPHOST',Location=''")
' Show the initial settings.
DisplaySettings("Initial Values")
' Set the log file mode to CentralW3C.
oSection.CentralLogFileMode = 2
' Enable central W3C logging.
oSection.CentralW3CLogFile.Enabled = True
' Set local time rollover to true.
oSection.CentralW3CLogFile.LocalTimeRollover = True
' Set the Period property to MaxSize.
oSection.CentralW3CLogFile.Period = 0
' Set the log truncate size to 100 megabytes.
oSection.CentralW3CLogFile.TruncateSize = 104857600
' Save the values to configuration.
oSection.Put_
' Refresh the oSection object variable with the new values.
oSection.Refresh_
' Show the changed settings.
Call DisplaySettings("New Values")
' ==== This section contains helper functions. ====
Function DisplaySettings(HeadingText)
WScript.Echo String(Len(HeadingText), "=")
WScript.Echo HeadingText
WScript.Echo String(Len(HeadingText), "=")
' Display the current central log file mode.
WScript.Echo "CentralLogFileMode: " & _
oSection.CentralLogFileMode
' Display the current W3C log file properties.
Call ShowPropVals(oSection.CentralW3CLogFile)
End Function
' Display the property values.
Function ShowPropVals(oObject)
For Each Prop In oObject.Properties_
WScript.Echo Prop.Name & ": " & Prop.Value
Next
WScript.Echo
End Function
상속 계층 구조
CentralW3CLogFile
요구 사항
형식 | Description |
---|---|
클라이언트 | - 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 |
제품 | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 |
MOF 파일 | WebAdministration.mof |
참고 항목
CentralBinaryLogFile 클래스
EmbeddedObject 클래스
LogSection 클래스
SiteLogFile 클래스