Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add status to response logging #12

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/MessageHandlers/PositionRequestHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void PositionRequestHandler(MessageFormats.HostServices.Position.Positio
message = output_request;

// Log the information about the message being sent to the source app.
_logger.LogInformation("Sending message '{messageType}' to '{appId}' (trackingId: '{trackingId}' / correlationId: '{correlationId}')", returnResponse.GetType().Name, fullMessage.SourceAppId, returnResponse.ResponseHeader.TrackingId, returnResponse.ResponseHeader.CorrelationId);
_logger.LogInformation("Sending message '{messageType}' to '{appId}' (trackingId: '{trackingId}' / correlationId: '{correlationId}'/ status: '{status}')", returnResponse.GetType().Name, fullMessage.SourceAppId, returnResponse.ResponseHeader.TrackingId, returnResponse.ResponseHeader.CorrelationId, returnResponse.ResponseHeader.Status);
// Send the return response to the source app.
_client.DirectToApp(appId: fullMessage.SourceAppId, message: returnResponse);
};
Expand Down
4 changes: 2 additions & 2 deletions src/MessageHandlers/PositionUpdateRequestHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ private void PositionUpdateRequestHandler(MessageFormats.HostServices.Position.P
message = output_request;

// Log the debug information about the message being saved to cache.
_logger.LogDebug("Saving '{messageType}' to cache as '{cache_name}' (trackingId: '{trackingId}' / correlationId: '{correlationId}')", message.Position.GetType().Name, CACHE_KEYS.LAST_KNOWN_POSITION, returnResponse.ResponseHeader.TrackingId, returnResponse.ResponseHeader.CorrelationId);
_logger.LogDebug("Saving '{messageType}' to cache as '{cache_name}' (trackingId: '{trackingId}' / correlationId: '{correlationId}' / status: '{status}')", message.Position.GetType().Name, CACHE_KEYS.LAST_KNOWN_POSITION, returnResponse.ResponseHeader.TrackingId, returnResponse.ResponseHeader.CorrelationId, returnResponse.ResponseHeader.Status);
// Save the message position to cache.
_client.SaveCacheItem(cacheItemName: CACHE_KEYS.LAST_KNOWN_POSITION, cacheItem: message.Position).Wait();

// Log the information about the message being sent to the source app.
_logger.LogInformation("Sending message '{messageType}' to '{appId}' (trackingId: '{trackingId}' / correlationId: '{correlationId}')", returnResponse.GetType().Name, fullMessage.SourceAppId, returnResponse.ResponseHeader.TrackingId, returnResponse.ResponseHeader.CorrelationId);
_logger.LogInformation("Sending message '{messageType}' to '{appId}' (trackingId: '{trackingId}' / correlationId: '{correlationId}' / status: '{status}')", returnResponse.GetType().Name, fullMessage.SourceAppId, returnResponse.ResponseHeader.TrackingId, returnResponse.ResponseHeader.CorrelationId, returnResponse.ResponseHeader.Status);
// Send the return response to the source app.
_client.DirectToApp(appId: fullMessage.SourceAppId, message: returnResponse);
};
Expand Down
Loading