From 43854e3a37d20b9fe92203a6364ef9af3a838668 Mon Sep 17 00:00:00 2001 From: Neil South Date: Tue, 9 Jan 2024 14:37:33 +0000 Subject: [PATCH] improve hl7 logging Signed-off-by: Neil South --- src/InformaticsGateway/Logging/Log.800.Hl7Service.cs | 4 ++-- src/InformaticsGateway/Services/HealthLevel7/MllpClient.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/InformaticsGateway/Logging/Log.800.Hl7Service.cs b/src/InformaticsGateway/Logging/Log.800.Hl7Service.cs index 10dca329..79c4737d 100755 --- a/src/InformaticsGateway/Logging/Log.800.Hl7Service.cs +++ b/src/InformaticsGateway/Logging/Log.800.Hl7Service.cs @@ -57,8 +57,8 @@ public static partial class Log [LoggerMessage(EventId = 811, Level = LogLevel.Debug, Message = "HL7 bytes received: {length}.")] public static partial void Hl7MessageBytesRead(this ILogger logger, int length); - [LoggerMessage(EventId = 812, Level = LogLevel.Debug, Message = "Parsing message with {length} bytes.")] - public static partial void Hl7GenerateMessage(this ILogger logger, int length); + [LoggerMessage(EventId = 812, Level = LogLevel.Debug, Message = "Parsing message with {length} bytes. {message}")] + public static partial void Hl7GenerateMessage(this ILogger logger, int length, string message); [LoggerMessage(EventId = 813, Level = LogLevel.Debug, Message = "Waiting for HL7 message.")] public static partial void HL7ReadingMessage(this ILogger logger); diff --git a/src/InformaticsGateway/Services/HealthLevel7/MllpClient.cs b/src/InformaticsGateway/Services/HealthLevel7/MllpClient.cs index 3d326b77..2912de8b 100755 --- a/src/InformaticsGateway/Services/HealthLevel7/MllpClient.cs +++ b/src/InformaticsGateway/Services/HealthLevel7/MllpClient.cs @@ -211,7 +211,7 @@ private bool CreateMessage(int startIndex, int endIndex, ref string data, out Me try { var text = data.Substring(messageStartIndex, endIndex - messageStartIndex); - _logger.Hl7GenerateMessage(text.Length); + _logger.Hl7GenerateMessage(text.Length, text); message = new Message(text); message.ParseMessage(); data = data.Length > endIndex ? data.Substring(messageEndIndex) : string.Empty;