CentralBinaryLogFile 클래스1
서버에서 중앙 집중식 이진 로깅에 대한 설정을 구성합니다.
구문
class CentralBinaryLogFile : EmbeddedObject
메서드
이 클래스에는 메서드가 없습니다.
속성
다음 표에서는 클래스에 의해 노출되는 속성을 나열합니다 CentralBinaryLogFile
.
속성 | Description |
---|---|
Directory |
로그 항목을 쓸 디렉터리를 지정하는 읽기/쓰기 string 값입니다. 기본값은 "%SystemDrive%\inetpub\logs\LogFiles"입니다. |
Enabled |
읽기/쓰기 boolean 값입니다. true 중앙 집중식 이진 로깅을 사용하도록 설정하면 이고, 그렇지 않으면 입니다 false . 기본값은 true 입니다. |
LocalTimeRollover |
읽기/쓰기 boolean 값입니다. true 새 로그 파일이 현지 시간을 기반으로 하면 이고, false UTC(협정 세계시)를 기반으로 하는 경우 입니다. 기본값은 false 입니다. |
Period |
현재 로그 파일이 닫혀 있고 새 로그 파일이 시작되는 빈도를 지정하는 읽기/쓰기 sint32 열거형입니다. 가능한 값은 설명 섹션의 뒷부분에 나와 있습니다. |
TruncateSize |
로그 파일 내용을 잘라야 하는 크기를 바이트 단위로 지정하는 읽기/쓰기 string 값입니다. 가 로 설정된 MaxSize 경우 Period 이 특성을 구성해야 합니다. 크기는 1048576(1메가바이트)와 4294967295(4GB) 사이여야 합니다. 기본값은 20971520(20MB)입니다. |
를 서브클래싱합니다.
이 클래스에는 서브클래스가 없습니다.
설명
이 클래스의 인스턴스는 LogSection 클래스의 속성에 포함 CentralBinaryLogFile
됩니다.
다음 표에서는 속성에 사용할 수 있는 값을 나열합니다 Period
. 기본값은 1(Daily
)입니다.
값 | 키워드 | Description |
---|---|---|
0 | MaxSize |
로그 파일이 닫혀 있고 의 값 TruncateSize 에 도달하면 새 로그 파일이 시작됩니다. |
1 | Daily |
로그 파일이 닫혀 있고 새 로그 파일이 하루에 한 번 시작됩니다. |
2 | Weekly |
로그 파일이 닫혀 있고 새 로그 파일이 일주일에 한 번 시작됩니다. |
3 | Monthly |
로그 파일이 닫혀 있고 새 로그 파일이 한 달에 한 번 시작됩니다. |
4 | Hourly |
로그 파일이 닫혀 있고 새 로그 파일이 시간당 한 번 시작됩니다. |
예제
다음 코드 예제에서는 로그 파일 모드를 CentralBinary
로 설정하고, 이진 로깅을 사용하도록 설정하고, 속성을 Weekly
로 설정하고Period
, 로그 파일이 현지 시간을 사용하도록 지정하고, 로그 크기를 1기가바이트로 제한합니다. 도우미 함수는 변경 전과 후에 설정을 표시합니다.
' 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 CentralBinary.
oSection.CentralLogFileMode = 1
' Enable central binary logging.
oSection.CentralBinaryLogFile.Enabled = True
' Set local time rollover to true.
oSection.CentralBinaryLogFile.LocalTimeRollover = True
' Set the Period property to Weekly.
oSection.CentralBinaryLogFile.Period = 2
' Set the log truncate size to 1 gigabyte.
oSection.CentralBinaryLogFile.TruncateSize = 1073741824
' 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 binary log file properties.
Call ShowPropVals(oSection.CentralBinaryLogFile)
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
상속 계층 구조
CentralBinaryLogFile
요구 사항
형식 | 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 |
참고 항목
CentralW3CLogFile 클래스
EmbeddedObject 클래스
LogSection 클래스
SiteLogFile 클래스