diff --git a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Configuration/ISettings.cs b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Configuration/ISettings.cs
index f89c013..c5c01f1 100644
--- a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Configuration/ISettings.cs
+++ b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Configuration/ISettings.cs
@@ -128,6 +128,11 @@ public interface ISettings
///
bool LogResponseErrors { get; set; }
+ ///
+ /// Gets or sets a value that determines if order creation requests and responses should always be logged.
+ ///
+ bool LogOrderCreationRequests { get; set; }
+
///
/// Gets or sets the recipient's email address for notification emails.
///
diff --git a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Configuration/Settings.cs b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Configuration/Settings.cs
index 46743a7..a68c1f2 100644
--- a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Configuration/Settings.cs
+++ b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Configuration/Settings.cs
@@ -428,6 +428,12 @@ public string InstanceName
/// true if a copy should be saved; otherwise, false.
public bool SaveCopyOfOrderXml { get; set; }
+ ///
+ /// Gets or sets a value that determines if order creation requests and responses should always be logged,
+ /// even when general request/response logging is disabled.
+ ///
+ public bool LogOrderCreationRequests { get; set; }
+
#endregion Logs parameters
///
@@ -481,6 +487,7 @@ public static void UpdateFrom(ISettings source, ISettings target)
target.LogResponseErrors = source.LogResponseErrors;
target.LogGeneralErrors = source.LogGeneralErrors;
target.LogDebugInfo = source.LogDebugInfo;
+ target.LogOrderCreationRequests = source.LogOrderCreationRequests;
target.LogMaxSize = source.LogMaxSize;
target.KeepLogFiles = source.KeepLogFiles;
diff --git a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Dynamicweb.Ecommerce.DynamicwebLiveIntegration.csproj b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Dynamicweb.Ecommerce.DynamicwebLiveIntegration.csproj
index c5a7b99..66d42dc 100644
--- a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Dynamicweb.Ecommerce.DynamicwebLiveIntegration.csproj
+++ b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Dynamicweb.Ecommerce.DynamicwebLiveIntegration.csproj
@@ -1,6 +1,6 @@
- 10.21.7
+ 10.21.8
1.0.0.0
Live Integration
Live Integration
diff --git a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/LiveIntegrationAddIn.cs b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/LiveIntegrationAddIn.cs
index d9d1e04..c4ee907 100644
--- a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/LiveIntegrationAddIn.cs
+++ b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/LiveIntegrationAddIn.cs
@@ -639,6 +639,15 @@ public LiveIntegrationAddIn()
[AddInParameterOrder(370)]
public bool LogDebugInfo { get; set; }
+ ///
+ /// Gets or sets a value that determines if order creation requests and responses should always be logged.
+ ///
+ [AddInParameter("Log order creation request and response")]
+ [AddInParameterEditor(typeof(YesNoParameterEditor), "")]
+ [AddInParameterGroup("Logs")]
+ [AddInParameterOrder(375)]
+ public bool LogOrderCreationRequests { get; set; }
+
#endregion Logs parameters
#endregion Configuration parameters
diff --git a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Logging/Logger.cs b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Logging/Logger.cs
index 5c81b35..1f73546 100644
--- a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Logging/Logger.cs
+++ b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Logging/Logger.cs
@@ -54,6 +54,13 @@ public Logger(Settings settings)
/// true if [log debug information]; otherwise, false.
private bool LogDebugInfo => _settings.LogDebugInfo;
+ ///
+ /// Set to true before an order-creation ERP call to enable per-call logging
+ /// when is on but general debug
+ /// logging is off. Reset to false immediately after the call.
+ ///
+ public bool IsOrderCreationContext { get; set; }
+
///
/// Gets or sets a value that determines if general info should be logged.
///
@@ -169,11 +176,11 @@ private bool IsAllowedAddToLog(ErrorLevel level)
switch (level)
{
case ErrorLevel.ConnectionError:
- result = LogConnectionErrors;
+ result = LogConnectionErrors || (IsOrderCreationContext && _settings.LogOrderCreationRequests);
break;
case ErrorLevel.ResponseError:
- result = LogResponseErrors;
+ result = LogResponseErrors || (IsOrderCreationContext && _settings.LogOrderCreationRequests);
break;
case ErrorLevel.Error:
@@ -181,7 +188,7 @@ private bool IsAllowedAddToLog(ErrorLevel level)
break;
case ErrorLevel.DebugInfo:
- result = LogDebugInfo;
+ result = LogDebugInfo || (IsOrderCreationContext && _settings.LogOrderCreationRequests);
break;
case ErrorLevel.EmailSend:
diff --git a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/OrderHandler.cs b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/OrderHandler.cs
index 891b0dd..3a82699 100644
--- a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/OrderHandler.cs
+++ b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/OrderHandler.cs
@@ -137,7 +137,9 @@ private static ResponseCacheLevel GetOrderCacheLevel(Settings settings)
var ctx = new OrderResponseContext(settings, erpControlsDiscount);
+ logger.IsOrderCreationContext = createOrder;
XmlDocument response = GetResponse(ctx, requestXml, order, createOrder, logger, out bool? requestCancelled, liveIntegrationSubmitType);
+ logger.IsOrderCreationContext = false;
if (response != null && !string.IsNullOrWhiteSpace(response.InnerXml))
{
bool processResponseResult = ProcessResponse(ctx, response, order, createOrder, successOrderStateId, failedOrderStateId, logger);