Previously, developers were limited to the default log levels and filters hardcoded into DAB. With release 1.6, you can now configure filters and levels for logs emitted by the engine. This release also adds new sinks. In addition to Application Insights and OpenTelemetry publishing, Data API builder now supports both file and Azure Log Analytics as targets. Rich, configurable logging wherever you need it.
{
"telemetry": {
"log-level": { },
"open-telemetry": { },
"application-insights": { },
"azure-log-analytics": { }, // ⭐ new!
"file": { } // ⭐ new!
}
}
}
File sink (⭐ new!)
Until now, DAB developers were mostly limited to console logs in the container. With release 1.6, you can sink logs to local files in a container folder to systematically debug and observe DAB behavior in your preferred monitoring solution. Mounting a container volume as the target folder makes it easy to preserve logs across container lifecycles.
Example file sink configuration:
{
"telemetry": {
"file": {
"enabled": ..., // Turn file logging on or off
"path": ..., // Folder path for log files
"rolling-interval": ..., // How often a new log file is created
"retained-file-count-limit": ..., // Max number of log files to keep
"file-size-limit-bytes": ..., // Max size of a log file before rolling
}
}
}
}
Azure Log Analytics Sink (⭐ new!)
Enterprise developers often face stricter requirements than local debugging can meet. Many organizations mandate centralized logging, compliance auditing, and integration with corporate monitoring solutions. To support these scenarios, Data API builder integrates with Azure Log Analytics. Logs flow into a secure, centralized platform that aligns with enterprise policies for retention, governance, and observability.
Example Azure Log Analytics sink configuration:
{
"telemetry": {
"azure-log-analytics": {
"enabled": true, // Turn logging on or off
"auth": {
"workspace-id": "xyz", // Workspace ID
"dcr-immutable-id": "dcr-xyz", // Data Collection Rule
"dce-endpoint": "https://xyz.azure.com" // Data Collection Endpoint
},
"dab-identifier": "dab-prod-api", // Unique string to identify log source
"flush-interval-seconds": 30 // How often logs are flushed
}
}
}
Versus Application Insights Where Application Insights focuses on application performance monitoring (APM), Azure Log Analytics provides broader coverage. It aggregates logs from applications, Azure resources, VMs, containers, networks, and security tools. These logs are centralized in a workspace for Kusto Query Language (KQL) queries, correlation, and compliance. Read the docs: What’s new for version 1.6 – Data API builder | Microsoft Learn
Application Insights Azure Application Insights is a monitoring service that captures telemetry such as request details, performance counters, logs, and exceptions. Integrating it with Data API builder (DAB) helps you diagnose issues and monitor runtime behavior in production.
Example configuration:
"runtime": {
...
"telemetry": {
"application-insights": {
"enabled": true,
"connection-string": "@env('app-insights-connection-string')"
}
}
}
Read the docs:
Use Azure Application Insights in Data API builder – Data API builder | Microsoft Learn
OpenTelemetry Data API builder (DAB) also supports OpenTelemetry for distributed tracing and metrics. This enables you to monitor and diagnose application behavior across REST, GraphQL, database operations, and internal middleware. Telemetry is exported via the .NET OpenTelemetry SDK to your configured backend, such as Azure Monitor or Jaeger. Ensure your backend is running and reachable at the specified
endpoint. Example configuration:
{
"runtime": {
"telemetry": {
"open-telemetry": {
"enabled": true,
"endpoint": "http://otel-collector:4317",
"service-name": "dab",
"exporter-protocol": "grpc"
}
}
}
}
Read the docs:
Use OpenTelemetry and Activity Traces – Data API builder | Microsoft Learn
Filtered Log Levels Data API builder (DAB) also supports customizable, filtered log levels to help you control the verbosity and focus of logs. This lets you capture detailed diagnostics on specific components while keeping other areas quieter, improving your debugging and monitoring experience. Logging settings are configured in the
runtime.telemetry.log-level section of your configuration. You can specify log levels globally or target specific namespaces or classes for fine-grained control. Example configuration:
{
"runtime": {
"telemetry": {
"log-level": {
"Azure.DataApiBuilder.Core.Configurations.RuntimeConfigValidator": "Debug",
"Azure.DataApiBuilder.Core": "Information",
"default": "Warning"
}
}
}
}
Read the docs:
Use Filtered Log Levels – Data API builder | Microsoft Learn
0 comments