tracelistener

Can I attach a .NET TraceListener to an externally running process?

I am developing an application scheduling program that will run other applications using System.Diagnostics.Process. The external applications are of various types (some .NET and some not). For those external apps that have trace logging enabled, is there a way that I can attach the tracelistener of the parent/calling application to li...

Cannot select CustomTraceListener with "Type Selector" window in Enterprise Library 4.1

i created a Custom Trace Liastener inside a class library : namespace SendMailTraceListener { [ConfigurationElementType(typeof(CustomTraceListenerData))] public class SendEmailTraceListener : CustomTraceListener { public override void Write(string message) { throw new NotImplementedException(); ...

Adding WPF Text Writer Trace Listener in an Outlook Add In using wpf window/control

I'm working on a outlook 2003 AddIn using VSTO SE.We have few customized windows developed in WPF. It looks there are few client machines have problem with WPF rendering due to which there could be an exception due to addin is getting disabled. I added a outlook.exe.config and added trace listeners for wpf Trace sources. I set it up acc...

How does System.TraceListener prepend message with process name?

I have been looking at using System.Diagnostics.Trace for doing logging is a very basic app. Generally it does all I need it to do. The downside is that if I call Trace.TraceInformation("Some info"); The output is "SomeApp.Exe Information: 0: Some info". Initally this entertained me but no longer. I would like to just output "Some in...

.Net Windows Service and Custom Trace Listeners

I have all of my service logic encapsulated in class library. When I instantiate the class library in a command line app I receive my trace information. When I instantiate the class in a Windows Service, I see that my Custom trace listener has created the logs directory and start a file, but it stays a 0 KB. Both applications have thi...

System.Diagnostics.Trace.TraceListener UnsafeStringCopy exception from ASP.NET

I get an odd intermittent error when trying to write a Diagnostics.Trace message from an assembly used by an ASP.NET application. It's .NET 3.5 on IIS7. The code setup is that when web.config has debug specified I add an instance of HttpResponseTraceListener to System.Diagnostics.Trace.Listeners. I'm doing it that way so in my other a...

Adding tracelistener to web.config

I want to use below code with a website. Which config sections I should add to web.config to log the output into a file or windows eventlog ? using System.Diagnostics; // Singleton in real code Class Logger { // In constructor: Trace.AutoFlush = false; public void Log(message) { String formattedLog = formatLog(message)...