- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are a number of log messages generated from the C# SDK when I do any number of operations against the library. An example of some are:
- Setting response: 'AuthorizeNet.Api.Contracts.V1.getHostedPaymentPageResponse'
Response obtained: AuthorizeNet.Api.Contracts.V1.getHostedPaymentPageResponse
Retreiving Response from Url: 'https://apitest.authorize.net/xml/v1/request.api'
Creating PostRequest Url: 'https://apitest.authorize.net/xml/v1/request.api'
- Etc.
The application also uses the system.diagnostics for other debugging purposes and that cannot just be removed from the web.config (the web.config code within the BEGIN/END LEGACY is what is previously used). I updated the web.config to use the code within the BEGIN/END NEW CODE sections, but I still get the verbose logging messages.
Any suggestions? We still need the other logging to work but would like to disable the Authorize.NET logging. I'm open to custom code implementations as well.
<system.diagnostics> <!-- BEGIN LEGACY --> <trace autoflush="true" indentsize="4"> <listeners> <clear/> <add name="emailAdminListener" type="SolutionNamespace.TraceListeners.EmailToAdminTraceListener,SolutionNamespace,Version=1.0.0.0,Culture=neutral,PublicKeyToken=6986"/> <add name="logToDBListener" type="SolutionNamespace.TraceListeners.LogToDatabaseTraceListener,SolutionNamespace,Version=1.0.0.0,Culture=neutral,PublicKeyToken=6986"/> </listeners> </trace> <!-- END LEGACY --> <!-- BEGIN NEW CODE --> <sources> <source name="AnetDotNetSdkTrace" switchName="sourceSwitch" switchType="System.Diagnostics.SourceSwitch" propagateActivity="true"> <listeners> <add name="emailAdminListener" type="SolutionNamespace.TraceListeners.EmailToAdminTraceListener,SolutionNamespace,Version=1.0.0.0,Culture=neutral,PublicKeyToken=6986"/> <add name="logToDBListener" type="SolutionNamespace.TraceListeners.LogToDatabaseTraceListener,SolutionNamespace,Version=1.0.0.0,Culture=neutral,PublicKeyToken=6986"/> </listeners> </source> </sources> <switches> <add name="sourceSwitch" value="Error"/> </switches> <!-- END NEW CODE --> </system.diagnostics>
Solved! Go to Solution.
10-09-2019 12:20 PM - edited 10-09-2019 12:21 PM
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After some debugging I found the problem. The issue is that I have to use an older SDK version because all newer versions of the SDK have a bug that has yet to be fixed by AuthorizeNet. Unfortunately, the version I am using does not specify a TraceSource in the LogHelper.cs class. In newer versions "AnetDotNetSdkTrace" is the specified TraceSource. Because no TraceSource is specified in the older version, the default trace listeners are used. The solution is to build the source code from the older version and modify LogHelper.cs to specify a TraceSource (specifically AnetDotNetSdkTrace).
10-11-2019 07:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Provides a set of methods and properties that help debug your code. ... NET API Browser · System. ... You can customize the tracing output's target by adding TraceListener instances to or removing instances from the Listeners collection. ... In Visual Studio C# and Visual Basic projects, by default, the "DEBUG" conditional ...... 192.168.1.1
10-09-2019 09:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After some debugging I found the problem. The issue is that I have to use an older SDK version because all newer versions of the SDK have a bug that has yet to be fixed by AuthorizeNet. Unfortunately, the version I am using does not specify a TraceSource in the LogHelper.cs class. In newer versions "AnetDotNetSdkTrace" is the specified TraceSource. Because no TraceSource is specified in the older version, the default trace listeners are used. The solution is to build the source code from the older version and modify LogHelper.cs to specify a TraceSource (specifically AnetDotNetSdkTrace).
10-11-2019 07:15 AM