G
Guest
I've been looking at the Trace and TraceSwitch Classes i C# and I thrying to make it act more like java log4j.
What I want is to add two different tracelisteners (like EventLogTraceListener and TextWriterTraceListener) to the Trace class. I also want them to react on different TraceSwitch Levels. I dont want the windows eventlog to log anything else than errors. The textLog will log on the verbose level. Is there anyone here that knows how to do this
My point is that I want to be able to write ex. Trace.writeline(myTraceSwitch.TraceWarn,"My log Warning"); in the applikation code. The applikation will check for the switchlevel in myApp.exe.config and then write to the textlog if the config level was set to warn,info, or verbose. If the level was set to Error it would also write to the eventlog
Jens Aleniu
What I want is to add two different tracelisteners (like EventLogTraceListener and TextWriterTraceListener) to the Trace class. I also want them to react on different TraceSwitch Levels. I dont want the windows eventlog to log anything else than errors. The textLog will log on the verbose level. Is there anyone here that knows how to do this
My point is that I want to be able to write ex. Trace.writeline(myTraceSwitch.TraceWarn,"My log Warning"); in the applikation code. The applikation will check for the switchlevel in myApp.exe.config and then write to the textlog if the config level was set to warn,info, or verbose. If the level was set to Error it would also write to the eventlog
Jens Aleniu