Log Streaming
These instructions primarily apply to self-hosted users. To set up log streaming on the Fanoni Hosted instance, please reach out to info@fanoni.ai
Fanoni can be configured to stream service logs to your existing log management tools, like SumoLogic, DataDog, or Splunk. Centralizing log management allows for better observability and auditability, and offers real-time analytics capabilities.
Fanoni Logs
Fanoni server can stream the following to STDOUT
- Login Attempts
- Other troubleshooting information
- All RESTful interactions with FHIR resources, which are recorded as FHIR AuditEvent resources
To capture AuditEvent resources for any RESTful interactions you must set the server configuration for logAuditEvents
For batch requests and GraphQL queries, each individual read/search operation executed by the query generates its own log line. While these operations are logged separately, they all share the same request ID / trace ID for easy correlation and tracing.
Forwarding Logs via AWS Lambda
To forward logs from CloudWatch to external platforms, AWS Lambda functions are utilized. This involves creating Lambda functions that are triggered by new log entries in CloudWatch and are configured to push these logs to the chosen external logging system.
- For SumoLogic: Setup Guide
- For DataDog: Setup Guide
- For Splunk: Setup Guide
Log Correlation
Fanoni uses includes both request IDs and trace IDs to aid in log correlation, enhancing debugging and monitoring capabilities.
The request ID is automatically generated by the Fanoni server for each unique HTTP request.
Clients can pass in their own trace id in their request headers. Fanoni supports both the headers X-TRACE-ID or traceparent.
Example: Adding a trace id to a Fanoni GET request
- Typescript
- cURL
await medplum.readResource('Patient', 'homer-simpson', {
headers: {
'X-TRACE-ID': 'MY-TRACE-ID',
},
});
curl https://api.medplum.com/fhir/R4/Patient/homer-simpson \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/fhir+json" \
-H "X-TRACE-ID: "MY-TRACE-ID