WebSuccessAuditEvent 클래스

정의

성공적인 보안 이벤트에 대한 정보를 제공합니다.

public ref class WebSuccessAuditEvent : System::Web::Management::WebAuditEvent
public class WebSuccessAuditEvent : System.Web.Management.WebAuditEvent
type WebSuccessAuditEvent = class
    inherit WebAuditEvent
Public Class WebSuccessAuditEvent
Inherits WebAuditEvent
상속
파생

예제

다음 코드 예제에서는 클래스에서 WebSuccessAuditEvent 파생하여 사용자 지정 감사 이벤트를 만드는 방법을 보여줍니다.


using System;
using System.Text;
using System.Web;
using System.Web.Management;

namespace SamplesAspNet
{
    // Implements a custom WebSuccessAuditEvent class. 
    public class SampleWebSuccessAuditEvent :
        System.Web.Management.WebSuccessAuditEvent
    {
        private string customCreatedMsg, customRaisedMsg;

        // Invoked in case of events identified only by their event code.
        public SampleWebSuccessAuditEvent(string msg, 
            object eventSource, int eventCode)
            :
        base(msg, eventSource, eventCode)
        {
            // Perform custom initialization.
            customCreatedMsg =
                string.Format("Event created at: {0}",
                DateTime.Now.TimeOfDay.ToString());
        }

        // Invoked in case of events identified by their event code.and 
        // event detailed code.
        public SampleWebSuccessAuditEvent(string msg, object eventSource,
            int eventCode, int detailedCode)
            :
        base(msg, eventSource, eventCode, detailedCode)
        {
            // Perform custom initialization.
            customCreatedMsg =
            string.Format("Event created at: {0}",
                DateTime.Now.TimeOfDay.ToString());
        }


        // Raises the SampleWebSuccessAuditEvent.
        public override void Raise()
        {
            // Perform custom processing.
            customRaisedMsg =
                string.Format("Event raised at: {0}", 
                DateTime.Now.TimeOfDay.ToString());

            // Raise the event.
            WebBaseEvent.Raise(this);
        }

        // Obtains the current thread information.
        public WebRequestInformation GetRequestInformation()
        {
            // No customization allowed.
            return RequestInformation;
        }

        //Formats Web request event information.
        //This method is invoked indirectly by the provider using one of the
        //overloaded ToString methods.
        public override void FormatCustomEventDetails(WebEventFormatter formatter)
        {
            base.FormatCustomEventDetails(formatter);

            // Add custom data.
            formatter.AppendLine("");

            formatter.IndentationLevel += 1;
            formatter.AppendLine(
                "******** SampleWebSuccessAuditEvent Start ********");
            formatter.AppendLine(string.Format("Request path: {0}",
                RequestInformation.RequestPath));
            formatter.AppendLine(string.Format("Request Url: {0}",
                RequestInformation.RequestUrl));

            // Display custom event timing.
            formatter.AppendLine(customCreatedMsg);
            formatter.AppendLine(customRaisedMsg);

            formatter.AppendLine(
                "******** SampleWebSuccessAuditEvent End ********");

            formatter.IndentationLevel -= 1;
        }
    }
}
Imports System.Text
Imports System.Web
Imports System.Web.Management


' Implements a custom WebSuccessAuditEvent class. 

Public Class SampleWebSuccessAuditEvent
    Inherits System.Web.Management.WebSuccessAuditEvent
    Private customCreatedMsg, customRaisedMsg As String
    
    
    
    ' Invoked in case of events identified only by their event code.
    Public Sub New(ByVal msg As String, _
    ByVal eventSource As Object, ByVal eventCode As Integer)
        MyBase.New(msg, eventSource, eventCode)
        ' Perform custom initialization.
        customCreatedMsg = String.Format("Event created at: {0}", _
        DateTime.Now.TimeOfDay.ToString())

    End Sub
    
    
    ' Invoked in case of events identified by their event code.and 
    ' event detailed code.
    Public Sub New(ByVal msg As String, ByVal eventSource As Object, _
    ByVal eventCode As Integer, ByVal detailedCode As Integer)
        MyBase.New(msg, EventSource, eventCode, detailedCode)
        ' Perform custom initialization.
        customCreatedMsg = String.Format("Event created at: {0}", _
        DateTime.Now.TimeOfDay.ToString())

    End Sub
    
    
    
    ' Raises the SampleWebSuccessAuditEvent.
    Public Overrides Sub Raise() 
        ' Perform custom processing.
        customRaisedMsg = String.Format("Event raised at: {0}", _
        DateTime.Now.TimeOfDay.ToString())
        
        ' Raise the event.
        WebBaseEvent.Raise(Me)
    
    End Sub
    
    
    ' Obtains the current thread information.
    Public Function GetRequestInformation() As WebRequestInformation 
        ' No customization allowed.
        Return RequestInformation
    
    End Function 'GetRequestInformation
    
    
    'Formats Web request event information.
    'This method is invoked indirectly by the provider using one of the
    'overloaded ToString methods.
    Public Overrides Sub FormatCustomEventDetails(ByVal formatter _
    As WebEventFormatter)
        MyBase.FormatCustomEventDetails(formatter)

        ' Add custom data.
        formatter.AppendLine("")

        formatter.IndentationLevel += 1
        formatter.AppendLine("**SampleWebSuccessAuditEvent Start **")
        formatter.AppendLine(String.Format("Request path: {0}", _
        RequestInformation.RequestPath))
        formatter.AppendLine(String.Format("Request Url: {0}", _
        RequestInformation.RequestUrl))

        ' Display custom event timing.
        formatter.AppendLine(customCreatedMsg)
        formatter.AppendLine(customRaisedMsg)

        formatter.AppendLine("** SampleWebSuccessAuditEvent End **")

        formatter.IndentationLevel -= 1

    End Sub
End Class

다음 예제는 ASP.NET 상태 모니터링에서 이벤트를 사용할 수 있도록 하는 구성 파일의 발췌입니다.

<healthMonitoring
..enabled="true"
..heartBeatInterval="0">
  <providers>
    <add name="EventLogProvider"
    type="System.Web.Management.EventLogWebEventProvider,
    System.Web,Version=2.0.3600.0,Culture=neutral,
    PublicKeyToken=b03f5f7f11d50a3a"/>
  </providers>
  <eventMappings>
    <add  name="SampleWebSuccessAuditEvent"
      type="SamplesAspNet.SampleWebSuccessAuditEvent,
      websuccessauditevent,Version=1.0.1663.31140,
      Culture=neutral,
      PublicKeyToken=0d1fa0f69d94de96,
      processorArchitecture=MSIL"/>
  </eventMappings>
  <rules>
    <add name="Custom Failure Audit Default"
      eventName=" SampleWebFailureAuditEvent "
      provider="EventLogProvider"
      profile="Default"/>
  </rules>
</healthMonitoring>

설명

ASP.NET 상태 모니터링을 사용하면 프로덕션 및 운영 직원이 배포된 웹 애플리케이션을 관리할 수 있습니다. 네임스페이스에는 System.Web.Management 애플리케이션 상태 데이터 패키징을 담당하는 상태 이벤트 유형과 이 데이터 처리를 담당하는 공급자 유형이 포함됩니다. 또한 상태 이벤트를 관리하는 동안 도움이 되는 지원 유형도 포함합니다.

WebSuccessAuditEvent 클래스는 보안 관련 작업이 성공적으로 수행되는 경우에 사용됩니다. 이 예제는 웹 요청에 대한 성공적인 URL 권한 부여입니다.

다음 목록에서는 ASP.NET WebSuccessAuditEvent 형식의 이벤트가 발생하는 기능을 설명합니다.

WebSuccessAuditEvent 발생하면 ASP.NET 상태 모니터링은 관련 감사 성공 이벤트 발생 성능 카운터를 증가시키고 healthMonitoring 구성을 확인하여 공급자가 이벤트를 구독하는지 여부를 확인합니다. 공급자가 이벤트를 구독하는 경우 ASP.NET 처리를 위해 이벤트를 디스패치합니다.

메모

시스템 모니터(PerfMon)에서 감사 성공 이벤트 발생 성능 카운터를 보려면 AD 카운터 창의 Performance 개체> 드롭다운 목록에서 ASP.NET을 선택합니다. 성공 이벤트 발생 성능 카운터를 선택합니다. Add 단추를 클릭합니다. 자세한 내용은 모니터링 ASP.NET 애플리케이션 성능 참조하세요.

성공 감사는 예상 조건을 나타내므로 구독하지 않을 수 있습니다. 사이트에 대한 액세스 감사를 제공하기 위해 구독할 수 있습니다.

메모

대부분의 경우 구현된 ASP.NET 상태 모니터링 유형을 사용할 수 있으며 healthMonitoring 구성 섹션에서 값을 지정하여 상태 모니터링 시스템을 제어합니다. 상태 모니터링 형식에서 파생하여 고유한 사용자 지정 이벤트 및 공급자를 만들 수도 있습니다. 클래스에서 파생되는 예제는 WebSuccessAuditEvent 이 항목에 제공된 예제를 참조하세요.

생성자

Name Description
WebSuccessAuditEvent(String, Object, Int32, Int32)

제공된 매개 변수를 사용하여 클래스의 WebSuccessAuditEvent 새 인스턴스를 초기화합니다.

WebSuccessAuditEvent(String, Object, Int32)

제공된 매개 변수를 사용하여 클래스의 WebSuccessAuditEvent 새 인스턴스를 초기화합니다.

속성

Name Description
EventCode

이벤트와 연결된 코드 값을 가져옵니다.

(다음에서 상속됨 WebBaseEvent)
EventDetailCode

이벤트 세부 정보 코드를 가져옵니다.

(다음에서 상속됨 WebBaseEvent)
EventID

이벤트와 연결된 식별자를 가져옵니다.

(다음에서 상속됨 WebBaseEvent)
EventOccurrence

이벤트가 발생한 횟수를 나타내는 카운터를 가져옵니다.

(다음에서 상속됨 WebBaseEvent)
EventSequence

애플리케이션에서 이벤트가 발생한 횟수를 가져옵니다.

(다음에서 상속됨 WebBaseEvent)
EventSource

이벤트를 발생시키는 개체를 가져옵니다.

(다음에서 상속됨 WebBaseEvent)
EventTime

이벤트가 발생한 시간을 가져옵니다.

(다음에서 상속됨 WebBaseEvent)
EventTimeUtc

이벤트가 발생한 시간을 가져옵니다.

(다음에서 상속됨 WebBaseEvent)
Message

이벤트를 설명하는 메시지를 가져옵니다.

(다음에서 상속됨 WebBaseEvent)
ProcessInformation

ASP.NET 애플리케이션 호스팅 프로세스에 대한 정보를 가져옵니다.

(다음에서 상속됨 WebManagementEvent)
RequestInformation

웹 요청과 연결된 정보를 가져옵니다.

(다음에서 상속됨 WebAuditEvent)

메서드

Name Description
Equals(Object)

지정된 개체가 현재 개체와 같은지 여부를 확인합니다.

(다음에서 상속됨 Object)
FormatCustomEventDetails(WebEventFormatter)

이벤트 정보의 표준 서식을 제공합니다.

(다음에서 상속됨 WebBaseEvent)
GetHashCode()

기본 해시 함수로 사용됩니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type 가져옵니다.

(다음에서 상속됨 Object)
IncrementPerfCounters()

감사 성공 이벤트 성능 카운터를 증가 시켰습니다.

MemberwiseClone()

현재 Object단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
Raise()

구성된 공급자에게 이벤트가 발생했음을 알려 이벤트를 발생합니다.

(다음에서 상속됨 WebBaseEvent)
ToString()

표시를 위해 이벤트 정보의 형식을 지정합니다.

(다음에서 상속됨 WebBaseEvent)
ToString(Boolean, Boolean)

표시를 위해 이벤트 정보의 형식을 지정합니다.

(다음에서 상속됨 WebBaseEvent)

적용 대상

추가 정보