We’re having an issue in a deployed environment that we cannot debug. The issue is that a page is being rendered blank and we’re trying to figure out why. The application were having trouble with is a WCF Windows service with a reference to a registered PD4ML, version 385 for .NET 2.0 (pd4ml.prof.dotnet20.385). We’ve turned on PD4ML.enableDebugInfo() and from what we understand, it writes to the console when it logs, so we’ve tried hooking into it using the code below, but no logs are showing. We’ve also checked the event viewer, but nothing is written there either. We have, however, been successful with debugging locally using a console application.
Could someone please help us understand where we can find the debug information in a deployed environment for a Windows service?
I’ve forwarded the question to our .NET team. I’ll let you know as soon as we have new info.
Much appreciated! However, we figured out it out. See below.
1. In the OnStart function of Windows Service Host class, add the following code: <br />
Console.SetError(New System.IO.StreamWriter("[filename]")<br />
2. Then in the OnStop function, add the following code: <br />
I’m sure there are other ways to do this such as creating your own custom System.Diagnostics listener, but this way works too. One thing to note is that you will need to stop the service in order to see the logs that were written.