Share via


WebManagementEventLog.Write Method

Definition

Writes event-related information to the Windows event log.

Overloads

Write(Int32, String)

Writes the event ID and a message to the Windows event log.

Write(String, EventLogEntryType, Int32)

Writes the event log message, entry type, and event ID to the Windows event log.

Write(Int32, String, String, String, Exception)

Writes the event ID, error message, connection name, connection user, and exception to the Windows event log.

Write(Int32, String, String, String, Exception, EventLogEntryType)

Writes the event ID, error message, connection name, connection user, exception, and event log entry type to the Windows event log.

Write(Int32, String)

Writes the event ID and a message to the Windows event log.

public:
 static void Write(int eventId, System::String ^ message);
public static void Write (int eventId, string message);
static member Write : int * string -> unit
Public Shared Sub Write (eventId As Integer, message As String)

Parameters

eventId
Int32

The event ID.

message
String

The message to write to the event log.

Applies to

Write(String, EventLogEntryType, Int32)

Writes the event log message, entry type, and event ID to the Windows event log.

public:
 static void Write(System::String ^ message, System::Diagnostics::EventLogEntryType entryType, int eventId);
public static void Write (string message, System.Diagnostics.EventLogEntryType entryType, int eventId);
static member Write : string * System.Diagnostics.EventLogEntryType * int -> unit
Public Shared Sub Write (message As String, entryType As EventLogEntryType, eventId As Integer)

Parameters

message
String

The message to write to the event log.

entryType
EventLogEntryType

One of the EventLogEntryType values.

eventId
Int32

The event ID.

Applies to

Write(Int32, String, String, String, Exception)

Writes the event ID, error message, connection name, connection user, and exception to the Windows event log.

public:
 static void Write(int eventId, System::String ^ message, System::String ^ connectionName, System::String ^ connectionUser, Exception ^ exception);
public static void Write (int eventId, string message, string connectionName, string connectionUser, Exception exception);
static member Write : int * string * string * string * Exception -> unit

Parameters

eventId
Int32

The event ID.

message
String

The message to write to the event log.

connectionName
String

The name of the current connection.

connectionUser
String

The Windows domain or local account name of the user whose credentials are being used in the connection.

exception
Exception

An Exception that contains an error that occurred during the connection.

Applies to

Write(Int32, String, String, String, Exception, EventLogEntryType)

Writes the event ID, error message, connection name, connection user, exception, and event log entry type to the Windows event log.

public:
 static void Write(int eventId, System::String ^ message, System::String ^ connectionName, System::String ^ connectionUser, Exception ^ exception, System::Diagnostics::EventLogEntryType entryType);
public static void Write (int eventId, string message, string connectionName, string connectionUser, Exception exception, System.Diagnostics.EventLogEntryType entryType);
static member Write : int * string * string * string * Exception * System.Diagnostics.EventLogEntryType -> unit

Parameters

eventId
Int32

The event ID.

message
String

The message to write to the event log.

connectionName
String

The name of the current connection.

connectionUser
String

The Windows domain or local account name of the user whose credentials are being used in the connection.

exception
Exception

A Exception that contains an error that occurred during the connection.

entryType
EventLogEntryType

One of the EventLogEntryType values.

Applies to