splunk / splunk-sdk-csharp-pcl

Splunk's next generation C# SDK
https://dev.splunk.com/enterprise/docs/csharp
Apache License 2.0
64 stars 46 forks source link

Not working as Expected with MVC Project #49

Closed efaruk closed 7 years ago

efaruk commented 8 years ago

Not working with ASP.NET MVC project, you could reproduce this issue by your self. You guys using ConfigureAwaiter(false); in most of async methods but I think you lost in some cases, I'm not sure where it is. It's hanging when SendAsync called...

I used your PCL library in here: https://github.com/efaruk/playground/tree/master/log4net.Appender.SplunkAppenders. But I changed back to old sdk now. You can pick from history and try to reproduce issue...

Regards... EFP

glennblock commented 8 years ago

Hi @efaruk.

Sorry you are having issues.

Can you give us a repro for your issue, or give us more detail on how to reproduce this?

Also, I see you are trying to use the REST API for logging. This is not really the way we'd recommend going forward, namely because it requires leaking Splunk credentials, because it is harder to configure, and it doesn't scale.

Have you seen our .NET Logging library (http://dev.splunk.com/view/splunk-loglib-dotnet/SP-CAAAEX4)? It supports trace listeners and ETW. It can send data to Splunk via TCP, UDP and with our new highly efficient HTTP Event Collector (http://dev.splunk.com/view/event-collector/SP-CAAAE6M). You can use it with Log4Net today as Log4Net has support for Trace Listeners.

If you want to build a Log4Net specific appender, you can do that using the underlying Splunk.Logging.Common package (https://github.com/splunk/splunk-library-dotnetlogging/tree/master/src/Splunk.Logging.Common). This is what others 3rd partys like Serilog have done I believe.

efaruk commented 8 years ago

We are trying to consolidate log usage trough log4net not just for splunk, we have also our own log service and different target sources. So I don't want to discuss method here but we have our reasons. I also prefer standard log4net configuration parameters like most of users will be...

Yes you can reproduce the issue using my repo history: https://github.com/efaruk/playground/tree/master/log4net.Appender.SplunkAppenders

Commit Hash: 7454f4f98313bfe1b1f75d7ebf6ced32085837bd

https://github.com/efaruk/playground/tree/64640b43463a3dcad7fbcc3a9b47b2c693f2e2d6/log4net.Appender.SplunkAppenders

Note: I'm not using rest api, I'm using your .net specific client sdk (but old one) https://github.com/splunk/splunk-sdk-csharp

Good luck, best wishes...