WebApplicationLifetimeEventとは? わかりやすく解説

WebApplicationLifetimeEvent クラス

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

アプリケーション有効期間中に発生した重要なイベント表します

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

Public Class WebApplicationLifetimeEvent
    Inherits WebManagementEvent
Dim instance As WebApplicationLifetimeEvent
public class WebApplicationLifetimeEvent :
 WebManagementEvent
public ref class WebApplicationLifetimeEvent
 : public WebManagementEvent
public class WebApplicationLifetimeEvent extends
 WebManagementEvent
public class WebApplicationLifetimeEvent extends
 WebManagementEvent
解説解説

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

アプリケーション有効期間中のイベントには、アプリケーション起動イベントシャットダウン イベントなどありますアプリケーション終了した場合関連するイベント メッセージ フィールド参照することでその原因わかります

WebApplicationLifetimeEvent発生した場合ASP.NET Health Monitoring systemApplication Lifetime Events パフォーマンス カウンタ更新します。これらのイベント記録するには、構成ファイルhealthMonitoring セクションrules サブセクションWebApplicationLifetimeEvent追加します次に例を示します

<rules>
  <add name="Application Events"
    eventName="Application Lifetime Events"
    provider="EventLogProvider"
    profile="Default"
    minInterval="00:01:00" />
</rules>

Application Lifetime Events パフォーマンス カウンタには、ASP.NET有効期間中のイベントすべての総数格納されます。このパフォーマンス カウンタシステム モニタ (PerfMon) に表示するには、[カウンタ追加] ウィンドウで [パフォーマンス オブジェクト] ドロップダウンリストの [ASP.NET] をクリックしApplication Lifetime Events パフォーマンス カウンタ選択して、[追加] ボタンクリックします。詳細については、MSDN の「Using the System Monitor (PerfMon) with ASP.NET Applications」を参照してくださいイベント標準 EventLogWebEventProvider でログ記録することを許可してある場合イベント ビューアアプリケーション ログ選択するイベント表示できます詳細については、TechNetWindows Server 2003 に関するドキュメントの「Event Viewer」を参照してください

注意に関するメモメモ

ほとんどの場合ASP.NET 状態監視型は実装のまま使用でき、healthMonitoring 構成セクションに値を指定して ASP.NET Health Monitoring system制御できます。状態監視型の派生として独自のイベントおよびプロバイダ作成することもできますWebApplicationLifetimeEvent クラス派生例については、このトピックの例を参照してください

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

使用例使用例

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

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


' Implements a custom WebManagementEvent class. 

Public Class SampleWebApplicationLifetimeEvent
    Inherits System.Web.Management.WebApplicationLifetimeEvent
    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 related event detailed code.
    Public Sub New(ByVal
 msg As String, _
    ByVal eventSource As Object,
 _
    ByVal eventCode As Integer,
 _
    ByVal eventDetailCode As Integer)
        MyBase.New(msg, eventSource, _
        eventCode, eventDetailCode)
        ' Perform custom initialization.
        customCreatedMsg = _
        String.Format("Event created at: {0}",
 _
        DateTime.Now.TimeOfDay.ToString())
    End Sub 'New


    ' Raises the SampleWebRequestEvent.
    Public Overrides Sub
 Raise() 
        ' Perform custom processing. 
        customRaisedMsg = _
        String.Format("Event raised at: {0}"
 + _
        vbLf, DateTime.Now.TimeOfDay.ToString())
        ' Raise the event.
        MyBase.Raise()
    
    End Sub 'Raise
    
    'Formats Web request event information.
    Public Overrides Sub
 FormatCustomEventDetails( _
    ByVal formatter As WebEventFormatter)
        MyBase.FormatCustomEventDetails(formatter)

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

        formatter.IndentationLevel += 1

        formatter.TabSize = 4

        formatter.AppendLine( _
        "*SampleWebApplicationLifetimeEvent Start *")
        formatter.AppendLine("Custom information goes here")
        formatter.AppendLine( _
        "* SampleWebApplicationLifetimeEvent End *")
        ' Display custom event timing.
        formatter.AppendLine(customCreatedMsg)
        formatter.AppendLine(customRaisedMsg)

        formatter.IndentationLevel -= 1

    End Sub 'FormatCustomEventDetails
 
End Class 'SampleWebApplicationLifetimeEvent

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

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

        // Invoked in case of events identified only by 
        // their event code.
        public SampleWebApplicationLifetimeEvent(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 related event detailed code.
        public SampleWebApplicationLifetimeEvent(string
 msg, 
            object eventSource, int eventCode, 
            int eventDetailCode):
          base(msg, eventSource, eventCode, eventDetailCode)
        {
            // Perform custom initialization.
            customCreatedMsg =
             string.Format("Event created at: {0}",
             DateTime.Now.TimeOfDay.ToString());
        }


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

        //Formats Web request event information.
        public override void FormatCustomEventDetails(
            WebEventFormatter formatter)
        {
            base.FormatCustomEventDetails(formatter);

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

            formatter.IndentationLevel += 1;
    
            formatter.TabSize = 4;
       
            formatter.AppendLine(
                 "*SampleWebApplicationLifetimeEvent Start *");
            formatter.AppendLine("Custom information goes here");
            formatter.AppendLine(
                "* SampleWebApplicationLifetimeEvent End *");
            // Display custom event timing.
            formatter.AppendLine(customCreatedMsg);
            formatter.AppendLine(customRaisedMsg);
        
            formatter.IndentationLevel -= 1;

        }
    }

}

次の構成ファイル抜粋に、構成ファイルhealthMonitoring セクション構成して上記定義される SampleWebApplicationLifetimeEvent コードASP.NET Health Monitoring system追加する方法示しますイベントシステム追加するには、eventMappings セクション新しいエントリを追加してイベント定義しrules セクション新しいエントリに追加して、そのイベントプロバイダ対応付ける必要があります

<healthMonitoring
  enabled="true"
  heartBeatInterval="0">

    <eventMappings>
       <clear />
       <!-- Configure the application lifetime event -->
       <!-- object to handle the Web application events. -->
       <add name="SampleApplicationLifetimeEvents"
         type="System.Web.Management.SampleWebApplicationLifetimeEvent,
         System.Web,Version=2.0.3600.0,
         Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" />
     </eventMappings>

    <rules>
      <clear/>
       // Configure the connection between the 
       // application lifetime event object 
       // and the provider that must process it.
       <add name="Custom Application Events"
         eventName="SampleApplicationLifetimeEvents"
         provider="EventLogProvider"
         profile="Default"
         minInterval="00:01:00" />
    </rules>

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

WebApplicationLifetimeEvent コンストラクタ (String, Object, Int32)

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

指定したパラメータ使用して WebApplicationLifetimeEvent クラス初期化します。

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

Protected Friend Sub New
 ( _
    message As String, _
    eventSource As Object, _
    eventCode As Integer _
)
Dim message As String
Dim eventSource As Object
Dim eventCode As Integer

Dim instance As New WebApplicationLifetimeEvent(message,
 eventSource, eventCode)
protected internal WebApplicationLifetimeEvent (
    string message,
    Object eventSource,
    int eventCode
)
protected public:
WebApplicationLifetimeEvent (
    String^ message, 
    Object^ eventSource, 
    int eventCode
)
protected WebApplicationLifetimeEvent (
    String message, 
    Object eventSource, 
    int eventCode
)
protected internal function
 WebApplicationLifetimeEvent (
    message : String, 
    eventSource : Object, 
    eventCode : int
)

パラメータ

message

イベント関連付けられているメッセージ

eventSource

イベントソースであるオブジェクト

eventCode

イベント関連付けられているコードカスタム イベント実装する場合イベント コードを WebExtendedBase より大きくする必要があります

解説解説

このコンストラクタは、ASP.NET Health Monitoring system によって内部的に使用されます。WebApplicationLifetimeEvent オブジェクトインスタンス化には使用しませんが、このクラス継承する独自のイベント型を実装する場合には呼び出すことができます

メモメモ

WebApplicationLifetimeEvent コンストラクタは、コード直接使用するためのものではありません。ASP.NET によって呼び出されます。WebApplicationLifetimeEvent コンストラクタは、WebApplicationLifetimeEvent クラス派生場合呼び出すことができます

使用例使用例

WebApplicationLifetimeEventASP.NET カスタム状態イベント使用する方法次のコード例示します。このコード例主な目的は、使用するための正し構文を示すことです。

' 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 only by 
// their event code.
public SampleWebApplicationLifetimeEvent(string
 msg, 
    object eventSource, int eventCode):
  base(msg, eventSource, eventCode)
{
    // Perform custom initialization.
    customCreatedMsg =
    string.Format("Event created at: {0}",
    DateTime.Now.TimeOfDay.ToString());
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebApplicationLifetimeEvent クラス
WebApplicationLifetimeEvent メンバ
System.Web.Management 名前空間

WebApplicationLifetimeEvent コンストラクタ

WebApplicationLifetimeEvent クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
WebApplicationLifetimeEvent (String, Object, Int32) 指定したパラメータ使用して WebApplicationLifetimeEvent クラス初期化します。
WebApplicationLifetimeEvent (String, Object, Int32, Int32) 指定したパラメータ使用して WebApplicationLifetimeEvent クラス初期化します。
参照参照

関連項目

WebApplicationLifetimeEvent クラス
WebApplicationLifetimeEvent メンバ
System.Web.Management 名前空間

WebApplicationLifetimeEvent コンストラクタ (String, Object, Int32, Int32)

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

指定したパラメータ使用して WebApplicationLifetimeEvent クラス初期化します。

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

Protected Friend Sub New
 ( _
    message As String, _
    eventSource As Object, _
    eventCode As Integer, _
    eventDetailCode As Integer _
)
Dim message As String
Dim eventSource As Object
Dim eventCode As Integer
Dim eventDetailCode As Integer

Dim instance As New WebApplicationLifetimeEvent(message,
 eventSource, eventCode, eventDetailCode)
protected internal WebApplicationLifetimeEvent (
    string message,
    Object eventSource,
    int eventCode,
    int eventDetailCode
)
protected public:
WebApplicationLifetimeEvent (
    String^ message, 
    Object^ eventSource, 
    int eventCode, 
    int eventDetailCode
)
protected WebApplicationLifetimeEvent (
    String message, 
    Object eventSource, 
    int eventCode, 
    int eventDetailCode
)
protected internal function
 WebApplicationLifetimeEvent (
    message : String, 
    eventSource : Object, 
    eventCode : int, 
    eventDetailCode : int
)

パラメータ

message

イベント関連付けられているメッセージ

eventSource

イベントソースであるオブジェクト

eventCode

イベント関連付けられているコードカスタム イベント実装する場合イベント コードを WebExtendedBase より大きくする必要があります

eventDetailCode

イベント詳細な識別子指定する WebEventCodes 値。

解説解説

このコンストラクタは、ASP.NET Health Monitoring system によって内部的に使用されます。WebApplicationLifetimeEvent オブジェクトインスタンス化には使用しませんが、このクラス継承する独自のイベント型を実装する場合には呼び出すことができます

メモメモ

WebApplicationLifetimeEvent コンストラクタは、コード直接使用するためのものではありません。ASP.NET によって呼び出されます。WebApplicationLifetimeEvent コンストラクタは、WebApplicationLifetimeEvent クラス派生場合呼び出すことができます

使用例使用例

WebApplicationLifetimeEventASP.NET カスタム状態イベント使用する方法次のコード例示します。このコード例主な目的は、使用するための正し構文を示すことです。

' Invoked in case of events identified by their 
' event code.and related event detailed code.
Public Sub New(ByVal
 msg As String, _
ByVal eventSource As Object,
 _
ByVal eventCode As Integer,
 _
ByVal eventDetailCode As Integer)
    MyBase.New(msg, eventSource, _
    eventCode, eventDetailCode)
    ' 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 related event detailed code.
public SampleWebApplicationLifetimeEvent(string
 msg, 
    object eventSource, int eventCode, 
    int eventDetailCode):
  base(msg, eventSource, eventCode, eventDetailCode)
{
    // Perform custom initialization.
    customCreatedMsg =
     string.Format("Event created at: {0}",
     DateTime.Now.TimeOfDay.ToString());
}

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebApplicationLifetimeEvent クラス
WebApplicationLifetimeEvent メンバ
System.Web.Management 名前空間

WebApplicationLifetimeEvent プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ ApplicationInformation  監視中の現在のアプリケーションに関する情報格納している WebApplicationInformation オブジェクト取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ EventCode  イベント関連付けられているコード値を取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ EventDetailCode  イベント詳細コード取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ EventID  イベント関連付けられている識別子取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ EventOccurrence  イベント発生した回数を表すカウンタ取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ EventSequence  アプリケーションによるイベントの発生回数取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ EventSource  イベント発生させるオブジェクト取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ EventTime  イベント発生した時刻取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ EventTimeUtc  イベント発生した時刻取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ Message  イベント説明するメッセージ取得します。 ( WebBaseEvent から継承されます。)
パブリック プロパティ ProcessInformation  ASP.NET アプリケーション ホスト プロセスに関する情報取得します。 ( WebManagementEvent から継承されます。)
参照参照

関連項目

WebApplicationLifetimeEvent クラス
System.Web.Management 名前空間

その他の技術情報

ASP.NET の状態監視
healthMonitoring 要素 (ASP.NET 設定スキーマ)

WebApplicationLifetimeEvent メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

WebApplicationLifetimeEvent クラス
System.Web.Management 名前空間

その他の技術情報

ASP.NET の状態監視
healthMonitoring 要素 (ASP.NET 設定スキーマ)

WebApplicationLifetimeEvent メンバ

アプリケーション有効期間中に発生した重要なイベント表します

WebApplicationLifetimeEvent データ型公開されるメンバを以下の表に示します


プロテクト コンストラクタプロテクト コンストラクタ
  名前 説明
プロテクト メソッド WebApplicationLifetimeEvent オーバーロードされます。 WebApplicationLifetimeEvent クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ ApplicationInformation  監視中の現在のアプリケーションに関する情報格納している WebApplicationInformation オブジェクト取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ EventCode  イベント関連付けられているコード値を取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ EventDetailCode  イベント詳細コード取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ EventID  イベント関連付けられている識別子取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ EventOccurrence  イベント発生した回数を表すカウンタ取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ EventSequence  アプリケーションによるイベントの発生回数取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ EventSource  イベント発生させるオブジェクト取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ EventTime  イベント発生した時刻取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ EventTimeUtc  イベント発生した時刻取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ Message  イベント説明するメッセージ取得します。(WebBaseEvent から継承されます。)
パブリック プロパティ ProcessInformation  ASP.NET アプリケーション ホスト プロセスに関する情報取得します。(WebManagementEvent から継承されます。)
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

WebApplicationLifetimeEvent クラス
System.Web.Management 名前空間

その他の技術情報

ASP.NET の状態監視
healthMonitoring 要素 (ASP.NET 設定スキーマ)



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

辞書ショートカット

すべての辞書の索引

「WebApplicationLifetimeEvent」の関連用語











WebApplicationLifetimeEventのお隣キーワード
検索ランキング

   

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



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

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

©2024 GRAS Group, Inc.RSS