Server settings in log4net.config: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
 
Line 9: Line 9:


==Send logs to OpenTelemetry==
==Send logs to OpenTelemetry==
Application writes traces and uses [OpenTelemetry](https://opentelemetry.io/docs/) exporter to write them into provided endpoint
=== Traces ===
* Standard traces:
QPR ProcessAnalyzer can write traces and uses the OpenTelemetry (https://opentelemetry.io/docs) exporter to write them into the provided endpoint.
** _Microsoft.EntityFrameworkCore_ - to trace EntityFramework queries
 
** _Microsoft.AspNetCore_ - to trace ProcessAnalyzer API calls
There are the following standard traces written:
* ProcessAnalyzer traces:
* '''_Microsoft.EntityFrameworkCore_''' to trace EntityFramework queries.
** _QPR.ProcessAnalyzer.ExpressionQuery_ - to trace expression query evaluation
* '''_Microsoft.AspNetCore_''' to trace QPR ProcessAnalyzer API calls.
** _QPR.ProcessAnalyzer.DatabaseOperation_ - to trace queries to external data source
 
** _QPR.ProcessAnalyzer.ExpressionLanguage_ - to trace calls to Expression Language functions and properties
In addition, there are the following custom traces:
* If endpoint is not configured then traces are not collected and exported.
* '''_QPR.ProcessAnalyzer.ExpressionQuery_''' to trace expression query evaluation.
* Application writes metrics and uses [OpenTelemetry](https://opentelemetry.io/docs/) exporter to write them into provided endpoint
* '''_QPR.ProcessAnalyzer.DatabaseOperation_''' to trace queries to external data source.
* Standard metrics that should be written:
* '''_QPR.ProcessAnalyzer.ExpressionLanguage_''' to trace calls to expression language function and property calls.
** _Microsoft.AspNetCore_ - to track ProcessAnalyzer API calls
 
** _Microsoft.EntityFrameworkCore_ - to track EntityFramework status
If an endpoint is not configured, traces are not collected and exported.
** _Microsoft.Data.SqlClient.EventSource_ - to track SqlClient status
 
* If endpoint is not configured then metrics are not collected and exported.
=== Metrics ===
* Application writes logs and uses [OpenTelemetry](https://opentelemetry.io/docs/) exporter to write them into provided endpoint
QPR ProcessAnalyzer can write write metrics and uses the OpenTelemetry (https://opentelemetry.io/docs) exporter to write them into the 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/)
There are the following standard metrics are written:
** `OTEL_EXPORTER_OTLP_ENDPOINT` - sends all signals to the same collector
* '''_Microsoft.AspNetCore_''' to track QPR ProcessAnalyzer API calls.
** `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` - collector endpoint for traces
* '''_Microsoft.EntityFrameworkCore_''' to track EntityFramework status.
** `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` - collector endopint for metrics
* '''_Microsoft.Data.SqlClient.EventSource_''' to track SqlClient status.
** `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` - collector endpoint for logs
 
* Application writes logs with level `WARN` by default
If an endpoint is not configured, metrics are not collected and exported.
** 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 with level `WARN`, `ERROR`, `FATAL` additionally written into snowflake events table utilizing event's severity
=== Logs ===
** Writing logs controlled by `LOG_LEVEL` option for `METADATA` schema. If it is not set, than `WARN` level used. See [Snowflake documentation](https://docs.snowflake.com/en/sql-reference/parameters#label-log-level) for details.
QPR ProcessAnalyzer can write write logs and uses the OpenTelemetry (https://opentelemetry.io/docs) exporter to write them into the provided endpoint. If an endpoint is not configured, logs are not exported.
** To take new `LOG_LEVEL` into use service must be restarted
 
* Application writes traces into [endpoint, provided by Snowflake](https://docs.snowflake.com/en/developer-guide/snowpark-container-services/monitoring-services#publishing-otlp-application-metrics-and-traces) (#2504281133008#)
The following environment variables are used to control collecting and exporting telemetry data using OpenTelemetry Protocol Exporter (https://opentelemetry.io/docs/specs/otel/protocol/exporter):
** Writing traces controlled by `TRACE_LEVEL` option for `METADATA` schema. If it is not set, than `ALWAYS` level used. See [Snowflake documentation](https://docs.snowflake.com/en/sql-reference/parameters#label-trace-level) for details.
* '''OTEL_EXPORTER_OTLP_ENDPOINT''' sends all signals to the same collector.
* To take new `TRACE_LEVEL` into use service must be restarted
* '''OTEL_EXPORTER_OTLP_TRACES_ENDPOINT''' collector endpoint for traces.
** Application writes metrics into [endpoint, provided by Snowflake](https://docs.snowflake.com/en/developer-guide/snowpark-container-services/monitoring-services#publishing-otlp-application-metrics-and-traces) (#2504281133008#)
* '''OTEL_EXPORTER_OTLP_METRICS_ENDPOINT''' collector endopint for metrics.
* [Snowflake metrics](https://docs.snowflake.com/en/developer-guide/snowpark-container-services/monitoring-services#label-spcs-available-platform-metrics) that should be written:
* '''OTEL_EXPORTER_OTLP_LOGS_ENDPOINT''' collector endpoint for logs.
** _system_ - to track CPU and memory usage
 
** _system_limits_ - to check CPU and memory limits for container
QPR ProcessAnalyzer writes logs with level '''WARN''' by default. Logs with level '''WARN''', '''ERROR''', and '''FATAL''' additionally written into Snowflake events table utilizing event's severity. 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).
** _storage_ - to track storage volume used by SqlServer
 
* Writing metrics controlled by `METRIC_LEVEL` option for `METADATA` schema. If it is not set, than `ALL` level used. See [Snowflake documentation](https://docs.snowflake.com/en/sql-reference/parameters#label-metric-level) for details.
=== OpenTelemetry in Snowflake Native App ===
** To take new `METRIC_LEVEL` into use service must be restarted
Writing logs is controlled by the '''LOG_LEVEL''' option for '''METADATA''' schema. If it is not set, than '''WARN''' level used. See [Snowflake documentation](https://docs.snowflake.com/en/sql-reference/parameters#label-log-level) for details. To take new `LOG_LEVEL` into use service must be restarted.
 
Application writes traces into [endpoint, provided by Snowflake](https://docs.snowflake.com/en/developer-guide/snowpark-container-services/monitoring-services#publishing-otlp-application-metrics-and-traces). Writing traces controlled by `TRACE_LEVEL` option for `METADATA` schema. If it is not set, than `ALWAYS` level used. See [Snowflake documentation](https://docs.snowflake.com/en/sql-reference/parameters#label-trace-level) for details.
 
To take new `TRACE_LEVEL` into use service must be restarted. Application writes metrics into [endpoint, provided by Snowflake](https://docs.snowflake.com/en/developer-guide/snowpark-container-services/monitoring-services#publishing-otlp-application-metrics-and-traces).
 
[Snowflake metrics](https://docs.snowflake.com/en/developer-guide/snowpark-container-services/monitoring-services#label-spcs-available-platform-metrics) that should be written:
* '''_system_ to track CPU and memory usage.
* '''_system_limits_''' to check CPU and memory limits for container.
* '''_storage_''' to track storage volume used by SQL Server.
 
Writing metrics controlled by `METRIC_LEVEL` option for `METADATA` schema. If it is not set, than `ALL` level used. See [Snowflake documentation](https://docs.snowflake.com/en/sql-reference/parameters#label-metric-level) for details. To take new `METRIC_LEVEL` into use service must be restarted

Latest revision as of 09:48, 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

Traces

QPR ProcessAnalyzer can write traces and uses the OpenTelemetry (https://opentelemetry.io/docs) exporter to write them into the provided endpoint.

There are the following standard traces written:

  • _Microsoft.EntityFrameworkCore_ to trace EntityFramework queries.
  • _Microsoft.AspNetCore_ to trace QPR ProcessAnalyzer API calls.

In addition, there are the following custom traces:

  • _QPR.ProcessAnalyzer.ExpressionQuery_ to trace expression query evaluation.
  • _QPR.ProcessAnalyzer.DatabaseOperation_ to trace queries to external data source.
  • _QPR.ProcessAnalyzer.ExpressionLanguage_ to trace calls to expression language function and property calls.

If an endpoint is not configured, traces are not collected and exported.

Metrics

QPR ProcessAnalyzer can write write metrics and uses the OpenTelemetry (https://opentelemetry.io/docs) exporter to write them into the provided endpoint.

There are the following standard metrics are written:

  • _Microsoft.AspNetCore_ to track QPR ProcessAnalyzer API calls.
  • _Microsoft.EntityFrameworkCore_ to track EntityFramework status.
  • _Microsoft.Data.SqlClient.EventSource_ to track SqlClient status.

If an endpoint is not configured, metrics are not collected and exported.

Logs

QPR ProcessAnalyzer can write write logs and uses the OpenTelemetry (https://opentelemetry.io/docs) exporter to write them into the provided endpoint. If an endpoint is not configured, logs are not exported.

The following environment variables are used 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_TRACES_ENDPOINT collector endpoint for traces.
  • OTEL_EXPORTER_OTLP_METRICS_ENDPOINT collector endopint for metrics.
  • OTEL_EXPORTER_OTLP_LOGS_ENDPOINT collector endpoint for logs.

QPR ProcessAnalyzer writes logs with level WARN by default. Logs with level WARN, ERROR, and FATAL additionally written into Snowflake events table utilizing event's severity. 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).

OpenTelemetry in Snowflake Native App

Writing logs is controlled by the LOG_LEVEL option for METADATA schema. If it is not set, than WARN level used. See [Snowflake documentation](https://docs.snowflake.com/en/sql-reference/parameters#label-log-level) for details. To take new `LOG_LEVEL` into use service must be restarted.

Application writes traces into [endpoint, provided by Snowflake](https://docs.snowflake.com/en/developer-guide/snowpark-container-services/monitoring-services#publishing-otlp-application-metrics-and-traces). Writing traces controlled by `TRACE_LEVEL` option for `METADATA` schema. If it is not set, than `ALWAYS` level used. See [Snowflake documentation](https://docs.snowflake.com/en/sql-reference/parameters#label-trace-level) for details.

To take new `TRACE_LEVEL` into use service must be restarted. Application writes metrics into [endpoint, provided by Snowflake](https://docs.snowflake.com/en/developer-guide/snowpark-container-services/monitoring-services#publishing-otlp-application-metrics-and-traces).

[Snowflake metrics](https://docs.snowflake.com/en/developer-guide/snowpark-container-services/monitoring-services#label-spcs-available-platform-metrics) that should be written:

  • _system_ to track CPU and memory usage.
  • _system_limits_ to check CPU and memory limits for container.
  • _storage_ to track storage volume used by SQL Server.

Writing metrics controlled by `METRIC_LEVEL` option for `METADATA` schema. If it is not set, than `ALL` level used. See [Snowflake documentation](https://docs.snowflake.com/en/sql-reference/parameters#label-metric-level) for details. To take new `METRIC_LEVEL` into use service must be restarted