O
Oleg Ogurok
Hi all,
I have a .NET object exposed to a COM (VB6) application. When the
application calls the .NET methods, I'd like to use Trace.WriteLineIf() to
log trace info into an event log.
Usually with ASP.NET application, one can control the TraceLevel of a
TraceSwitch in web.config, and for WindowsForms or console applications, in
App.config file.
However, in this case I only have a shared library (assembly). How would I
control the trace level in this scenario?
Also I'm thinking of using Trace.WriteLineIf(mySwithch.TraceError, "error:
.....") instead of calling EventLog.WriteEntry(....,
EventLogEntryType.Error). The problem is that all events are logged as type
"Information". Is there a way to tell Trace class to log an event as type
"Error"?
Thanks,
-Oleg.
I have a .NET object exposed to a COM (VB6) application. When the
application calls the .NET methods, I'd like to use Trace.WriteLineIf() to
log trace info into an event log.
Usually with ASP.NET application, one can control the TraceLevel of a
TraceSwitch in web.config, and for WindowsForms or console applications, in
App.config file.
However, in this case I only have a shared library (assembly). How would I
control the trace level in this scenario?
Also I'm thinking of using Trace.WriteLineIf(mySwithch.TraceError, "error:
.....") instead of calling EventLog.WriteEntry(....,
EventLogEntryType.Error). The problem is that all events are logged as type
"Information". Is there a way to tell Trace class to log an event as type
"Error"?
Thanks,
-Oleg.