Open xantari opened 3 years ago
Another NLog issue to be aware of is this:
AuthenticationSdk.util.LogUtility expects "file" target to be set in NLog if FileTarget "file" is not set the AuthenticationSDK will disable logging which will disable logging for our entire application, not just cybersource
This is our workaround:
if (!NLog.LogManager.Configuration.AllTargets.Any((t) => string.Equals(t.Name,"file")))
{
var fileTarget = new NLog.Targets.FileTarget("file") { FileName = "file.log" };
NLog.LogManager.Configuration.AddTarget("file", fileTarget);
}
That's crazy, didn't know that. Definitely shouldn't be expected behavior.
NLog.LogManager.Configuration.Variables.Add("enableMasking", new NLog.Layouts.SimpleLayout("true"));
Your code doesn't indicate you have to setup NLog anywhere.
When it's not setup the entire nuget fails to load anything. It seems you have to not only setup NLog now, you also have to add a magic undocumented variable (had to search the source code to find it) called "enableMasking" and set it to true or false because your code doesn't do existence checking.
Stack trace when all undocumented variables and NLog setup not performed:
at AuthenticationSdk.util.LogUtility.IsMaskingEnabled(Logger logger) at CyberSource.Client.ApiClient.CallApi(String path, Method method, Dictionaryd__1.MoveNext() in C:\TFS\ARRT.All.Projects\ARRT.Payments.Services\Vendors\CyberSource\CyberSourceGateway.cs:line 65
2 queryParams, Object postBody, Dictionary
2 headerParams, Dictionary2 formParams, Dictionary
2 fileParams, Dictionary2 pathParams, String contentType) at CyberSource.Api.ReportsApi.SearchReportsWithHttpInfo(Nullable
1 startTime, Nullable1 endTime, String timeQueryType, String organizationId, String reportMimeType, String reportFrequency, String reportName, Nullable
1 reportDefinitionId, String reportStatus) at ARRT.Payments.Services.Vendors.CyberSource.CyberSourceGateway.