Information générale
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Network:
Windows 2003 Server
There appears to be three different logging types in MM (EventLog, TraceLog, and TransactionLog). You can write to one of these logs by using the following methods:
WriteException
WriteWarning
WriteInfo
WriteTrace
WriteTransaction
WriteException creates an entry in the Application category in the Windows Event Log as an "Error", WriteWarning creates an entry as a "Warning", and of course WriteInfo creates an entry as "Information". The source is the ApplicationName defined in App.cs.
WriteTransaction creates an entry in the same Application category in the Windows Event Log as "Information". However, the source is defined as (trx) + ApplicationName. This is kind of strange as I was expecting the Transaction Log to use a different event category called Transaction.
Now the really strange behavior is with WriteTrace. When I step through the code, it behaves differently than the other two and it tries to create an XML file that I think is supposed to be called EventLog.xml. The string variable holding the file name actually contains "Application" and I don't see it creating an XML file or an entry in the Windows Event Log.
I could use some clarification. How is the WriteTrace method supposed to work? What is the intent of the WriteTransaction method if it is just creating another entry in the Application with (trx) prepended to the source.
Thanks,
Al
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement