I've configured the APM agent to monitor a running application on IIS 7. I can't see the service in the APM server, so i thinks there's a problem somewhere. Looking around the forum i found this answer (After updating Apm Agent from 1.1.2 to 1.2 transactions are empty) saying that APM client logs to stdout. I'm not an expert in windows administration, but did some research and found that in IIS this means writing to Stream.null (something like /dev/null for we, linux people).
So, the question is, how to know what's happening if i cannot see the logs? Is there other way i can see what's happening? I'm not getting any kind of error in the Event Viewer.
Kibana version : 7.4 Elasticsearch version : 7.4 APM Server version : 7.4 APM Agent language and version : .NET Elastic.Apm.AspNetFullFramework 1.2.0 Original install method (e.g. download page, yum, deb, from source, etc.) and version : NuGet
We need some improvement in Agent's logging area - at the moment I see two options:
Redirect standard output to a file using Console.SetOut API.
A better solution would be to have Agent log via the logging framework you use for the rest of the application. Agent supports logger as a dependency. You can see an example for using NLog here.
Hi @Sergey_Kleyman, thanks for your answer. I don't have access to the source code. I need something that i can configure from the IIS or application web.config. The application seems to be using log4net, that's all i know.
Any other thoughts on how to test/debug the agent?
As I mentioned above long term we need some improvement in Agent's logging area.
Short term one possible solution might be to change the default sink for Agent's logger to System.Diagnostics.Trace instead of Console for ASP.NET/IIS applications. Users can use an utility such as DebugView to view the logs. It's a GUI utility so probably it will not work on a headless Windows and it will require remote desktop into the server. It might be possible to redirect System.Diagnostics.Trace to a file using just the configuration but I didn't try redirecting System.Diagnostics.Trace to a file before so that is not 100%. Can you use DebugView in your environment?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.