ApplicationBase.Log Eigenschaft
Definition
Ruft ein Objekt ab, das Eigenschaften und Methoden zum Schreiben von Ereignis- und Ausnahmeinformationen an die Protokollüberwachung der Anwendung bereitstellt.Gets an object that provides properties and methods for writing event and exception information to the application's log listeners.
public:
property Microsoft::VisualBasic::Logging::Log ^ Log { Microsoft::VisualBasic::Logging::Log ^ get(); };
public Microsoft.VisualBasic.Logging.Log Log { get; }
member this.Log : Microsoft.VisualBasic.Logging.Log
Public ReadOnly Property Log As Log
Eigenschaftswert
Das Log-Objekt der aktuellen Anwendung.The Log object for the current application.
Beispiele
Dieses Beispiel zeigt die Verwendung der My.Application.Log.WriteEntry
-Methode zum Protokollieren von Ablaufprotokollinformationen.This example shows how to use the My.Application.Log.WriteEntry
method to log tracing information. Weitere Informationen finden Sie unter Gewusst wie: Schreiben von Protokollmeldungen.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