AspLog Class
Assembly: Microsoft.VisualBasic (in microsoft.visualbasic.dll)
For more detailed information, see the Visual Basic topic My.Application.Log Object Object.
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 in Visual Basic.
The My.Application.Log object is available only for client applications. For Web applications, use My.Log. For more information, see My.Log Object.
The following table lists examples of tasks involving the My.Application.Log object.
| To | See |
|---|---|
| Write event information to the application's log listeners | |
| Write exception information to the application's log listeners | |
| Determine where My.Application.Log writes information | Walkthrough: Determining Where My.Application.Log Writes Information |
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
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.