ApplicationBase.Log Property

 

Gets an object that provides properties and methods for writing event and exception information to the application's log listeners.

Namespace:   Microsoft.VisualBasic.ApplicationServices
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

public Log Log { get; }

Property Value

Type: Microsoft.VisualBasic.Logging.Log

The Log object for the current application.

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 (Visual Basic).

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

.NET Framework
Available since 2.0
Return to top
Show: