AspLog AspLog AspLog AspLog Class

Definition

Provides a property and methods for writing event and exception information to the application's log listeners.

public ref class AspLog : Microsoft::VisualBasic::Logging::Log
public class AspLog : Microsoft.VisualBasic.Logging.Log
type AspLog = class
    inherit Log
Public Class AspLog
Inherits Log
Inheritance
AspLogAspLogAspLogAspLog

Examples

This example shows how to use the My.Application.Log.WriteEntry method to log tracing information. For more information, see How to: Write Log Messages.

Public Sub TracingTest(ByVal fileName As String)
    My.Application.Log.WriteEntry( 
        "Entering TracingTest with argument " & 
        fileName & ".")
    ' Code to trace goes here.
    My.Application.Log.WriteEntry( 
        "Exiting TracingTest with argument " & 
        fileName & ".")
End Sub

Remarks

The My.Application.Log object provides a straightforward entry point from which to access the .NET Framework's logging services. The WriteEntry and WriteException methods write messages to the application's log listeners. The listeners can be configured by the application's configuration file. For more information, see Walkthrough: Changing Where My.Application.Log Writes Information and Working with Application Logs.

The My.Application.Log object is available only for client applications. For Web applications, use My.Log. For more information, see Microsoft.VisualBasic.Logging.Log.

The following table lists examples of tasks involving the My.Application.Log object.

To See
Write event information to the application's log listeners How to: Write Log Messages
Write exception information to the application's log listeners How to: Log Exceptions
Determine where My.Application.Log writes information Walkthrough: Determining Where My.Application.Log Writes Information

Constructors

AspLog() AspLog() AspLog() AspLog()

Initializes a new instance of the AspLog class.

AspLog(String) AspLog(String) AspLog(String) AspLog(String)

Initializes a new instance of the AspLog class.

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
InitializeWithDefaultsSinceNoConfigExists() InitializeWithDefaultsSinceNoConfigExists() InitializeWithDefaultsSinceNoConfigExists() InitializeWithDefaultsSinceNoConfigExists()

Creates a new FileLogTraceListener and adds it to the Listeners collection.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
WriteEntry(String) WriteEntry(String) WriteEntry(String) WriteEntry(String)

Writes a message to the application's log listeners.

(Inherited from Log)
WriteEntry(String, TraceEventType) WriteEntry(String, TraceEventType) WriteEntry(String, TraceEventType) WriteEntry(String, TraceEventType)

Writes a message to the application's log listeners.

(Inherited from Log)
WriteEntry(String, TraceEventType, Int32) WriteEntry(String, TraceEventType, Int32) WriteEntry(String, TraceEventType, Int32) WriteEntry(String, TraceEventType, Int32)

Writes a message to the application's log listeners.

(Inherited from Log)
WriteException(Exception) WriteException(Exception) WriteException(Exception) WriteException(Exception)

Writes exception information to the application's log listeners.

(Inherited from Log)
WriteException(Exception, TraceEventType, String) WriteException(Exception, TraceEventType, String) WriteException(Exception, TraceEventType, String) WriteException(Exception, TraceEventType, String)

Writes exception information to the application's log listeners.

(Inherited from Log)
WriteException(Exception, TraceEventType, String, Int32) WriteException(Exception, TraceEventType, String, Int32) WriteException(Exception, TraceEventType, String, Int32) WriteException(Exception, TraceEventType, String, Int32)

Writes exception information to the application's log listeners.

(Inherited from Log)

Properties

DefaultFileLogWriter DefaultFileLogWriter DefaultFileLogWriter DefaultFileLogWriter

Gets the file the FileLogTraceListener object that underlies the Log object.

(Inherited from Log)
TraceSource TraceSource TraceSource TraceSource

Gets to the TraceSource object that underlies the Log object.

(Inherited from Log)

Applies to

See also