|
@@ -3,7 +3,7 @@ using EVCB_OCPP.Packet.Messages;
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
using Newtonsoft.Json;
|
|
|
using Newtonsoft.Json.Serialization;
|
|
|
-
|
|
|
+using NLog;
|
|
|
using OCPPServer.Protocol;
|
|
|
|
|
|
|
|
@@ -16,7 +16,7 @@ namespace EVCB_OCPP.WSServer.Message
|
|
|
/// </summary>
|
|
|
internal class BasicMessageHandler
|
|
|
{
|
|
|
- static protected ILogger logger;
|
|
|
+ static internal Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
|
|
|
|
|
#region 傳送 or 解析訊息需要欄位
|
|
|
private const int INDEX_MESSAGEID = 0;
|
|
@@ -83,7 +83,7 @@ namespace EVCB_OCPP.WSServer.Message
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- logger.LogError(string.Format("confirmation is null or InVaild in GenerateConfirmation Method"), "Warning");
|
|
|
+ logger.Error(string.Format("confirmation is null or InVaild in GenerateConfirmation Method"), "Warning");
|
|
|
}
|
|
|
return msg;
|
|
|
}
|
|
@@ -97,7 +97,7 @@ namespace EVCB_OCPP.WSServer.Message
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- logger.LogError(string.Format("confirmation is null or InVaild in GenerateConfirmation Method"), "Warning");
|
|
|
+ logger.Error(string.Format("confirmation is null or InVaild in GenerateConfirmation Method"), "Warning");
|
|
|
}
|
|
|
return msg;
|
|
|
}
|
|
@@ -116,17 +116,17 @@ namespace EVCB_OCPP.WSServer.Message
|
|
|
{
|
|
|
if(!request.Validate())
|
|
|
{
|
|
|
- logger.LogError("!Validate", "Warning");
|
|
|
+ logger.Error("!Validate", "Warning");
|
|
|
}
|
|
|
|
|
|
if (request == null)
|
|
|
{
|
|
|
- logger.LogError("!NULL", "Warning");
|
|
|
+ logger.Error("!NULL", "Warning");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
- logger.LogError(string.Format("confirmation is null or InVaild in GenerateRequest Method "+ action), "Warning");
|
|
|
+ logger.Error(string.Format("confirmation is null or InVaild in GenerateRequest Method "+ action), "Warning");
|
|
|
}
|
|
|
return msg;
|
|
|
}
|
|
@@ -141,7 +141,7 @@ namespace EVCB_OCPP.WSServer.Message
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- logger.LogError(string.Format("confirmation is null or InVaild in GenerateRequest Method"), "Warning");
|
|
|
+ logger.Error(string.Format("confirmation is null or InVaild in GenerateRequest Method"), "Warning");
|
|
|
}
|
|
|
return msg;
|
|
|
}
|