Server settings in log4net.config: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
Line 24: Line 24:
** _Microsoft.Data.SqlClient.EventSource_ - to track SqlClient status
** _Microsoft.Data.SqlClient.EventSource_ - to track SqlClient status
* If endpoint is not configured then metrics are not collected and exported.
* If endpoint is not configured then metrics are not collected and exported.
* Application writes logs and uses [OpenTelemetry](https://opentelemetry.io/docs/) exporter to write them into provided endpoint
** If endpoint is not configured then logs are not exported.
* Environment variables to control collecting and exporting telemetry data using [OpenTelemetry Protocol Exporter](https://opentelemetry.io/docs/specs/otel/protocol/exporter/)
* Environment variables to control collecting and exporting telemetry data using [OpenTelemetry Protocol Exporter](https://opentelemetry.io/docs/specs/otel/protocol/exporter/)
** `OTEL_EXPORTER_OTLP_ENDPOINT` - sends all signals to the same collector
** `OTEL_EXPORTER_OTLP_ENDPOINT` - sends all signals to the same collector
** `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` - collector endpoint for traces
** `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` - collector endpoint for traces
** `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` - collector endopint for metrics
** `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` - collector endopint for metrics
 
** `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` - collector endpoint for logs
* Application writes logs with level `WARN` by default   
* Application writes logs with level `WARN` by default   
** Logs are written into container's stdout stream using [JSON format for structured logging](https://learn.microsoft.com/en-us/dotnet/core/extensions/console-log-formatter#json)
** Logs are written into container's stdout stream using [JSON format for structured logging](https://learn.microsoft.com/en-us/dotnet/core/extensions/console-log-formatter#json)

Revision as of 09:16, 25 November 2025

QPR ProcessAnalyzer uses the log4net component (https://logging.apache.org/log4net/) for logging, allowing to flexibly define what is logged and where the logs are stored.

Write logs to file

For example, the following settings can be set in the log4net.config file (located in the bin folder in the server application files):

Send logs to OpenTelemetry

Application writes traces and uses [OpenTelemetry](https://opentelemetry.io/docs/) exporter to write them into provided endpoint