WebFailureAuditEvent クラスとは? わかりやすく解説

WebFailureAuditEvent クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

セキュリティ障害に関する情報提供します

名前空間: System.Web.Management
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Class WebFailureAuditEvent
    Inherits WebAuditEvent
Dim instance As WebFailureAuditEvent
public class WebFailureAuditEvent : WebAuditEvent
public ref class WebFailureAuditEvent : public
 WebAuditEvent
public class WebFailureAuditEvent extends WebAuditEvent
public class WebFailureAuditEvent extends
 WebAuditEvent
解説解説

運用および操作担当者は、ASP.NET Health Monitoring使用して配置されている Web アプリケーション管理できます。System.Web.Management 名前空間には、アプリケーションの状態データパッケージ化する状態イベント型、およびそのデータ処理するプロバイダ型が含まれます。また、状態イベント管理支援するサポート型も含まれます。

WebFailureAuditEvent クラスは、セキュリティ操作失敗する使用されます。たとえば、Web 要求対すURL 承認失敗した場合です。

既定では、ASP.NET次の機能について WebFailureAuditEvent イベント発生させるよう構成されています。

WebFailureAuditEvent イベント発生すると、ASP.NET Health Monitoring関連する Audit Failure Events Raised パフォーマンス カウンタインクリメントし、healthMonitoring 構成チェックしてそのイベントサブスクライブするプロバイダがあるかどうか確認します。このイベントサブスクライブするプロバイダがある場合ASP.NET はそのイベントディスパッチして処理さます。

メモメモ

Audit Failure Events Raised パフォーマンス カウンタシステム モニタ (PerfMon) に表示するには、[カウンタ追加] ウィンドウで [パフォーマンス オブジェクト] ドロップダウンリストの [ASP.NET] を選択し、[Audit Failure Events Raised] パフォーマンス カウンタ選択して、[追加] ボタンクリックします。詳細については、MSDNIIS に関するドキュメントの「Using the System Monitor (PerfMon) with ASP.NET Applications」を参照してくださいメモ   ほとんどの場合ASP.NET 状態監視型は実装のまま使用でき、healthMonitoring 構成セクションに値を指定して ASP.NET Health Monitoring system制御できます。状態監視型の派生として独自のイベントおよびプロバイダ作成することもできますWebFailureAuditEvent クラス派生例については、このトピックの例を参照してください

継承時の注意 カスタム イベント情報表示用に書式設定する場合は、ToString メソッドではなく、FormatCustomEventDetails メソッドオーバーライドます。これにより、重要なシステム情報対す上書き不正な変更防げます。

使用例使用例

WebFailureAuditEvent クラス派生としてカスタム監査イベント作成する方法次のコード例示します

Imports System
Imports System.Text
Imports System.Web
Imports System.Web.Management


' Implements a custom WebFailureAuditEvent class. 

Public Class SampleWebFailureAuditEvent
    Inherits System.Web.Management.WebFailureAuditEvent
    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 'New
    
    
    ' 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 'New
    
    
    
    ' Raises the SampleWebFailureAuditEvent.
    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 'Raise
    
    
    ' Obtains the current thread information.
    Public Function GetRequestInformation()
 As WebRequestInformation 
        ' No customization is 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("******** SampleWebFailureAuditEvent
 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("******** SampleWebFailureAuditEvent
 End ********")

        formatter.IndentationLevel -= 1

    End Sub 'FormatCustomEventDetails
 

End Class 'SampleWebFailureAuditEvent

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

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


        // Invoked in case of events identified only by their event
 code.
        public SampleWebFailureAuditEvent(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 SampleWebFailureAuditEvent(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 SampleWebFailureAuditEvent.
        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 is 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(
                "******** SampleWebFailureAuditEvent 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(
                "******** SampleWebFailureAuditEvent End ********");

            formatter.IndentationLevel -= 1;

        }
    }

}

次に示すのは、ASP.NETWebFailureAuditEvent イベント使用できるようにする方法を示す構成抜粋です。

<healthMonitoring 
enabled="true"
heartBeatInterval="0"> 
<providers>
							
<eventMappings>
							
</healthMonitoring>
継承階層継承階層
System.Object
   System.Web.Management.WebBaseEvent
     System.Web.Management.WebManagementEvent
       System.Web.Management.WebAuditEvent
        System.Web.Management.WebFailureAuditEvent
           System.Web.Management.WebAuthenticationFailureAuditEvent
           System.Web.Management.WebViewStateFailureAuditEvent
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebFailureAuditEvent メンバ
System.Web.Management 名前空間
WebAuditEvent クラス
WebSuccessAuditEvent
WebEventCodes クラス
その他の技術情報
healthMonitoring 要素 (ASP.NET 設定スキーマ)
ASP.NET の状態監視
ASP.NET ビューステート



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「WebFailureAuditEvent クラス」の関連用語

WebFailureAuditEvent クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



WebFailureAuditEvent クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS