Nomirun SDK supports default frameworks ILogger<T> implementation.
The default implementation of ILogger<T> in ASP.NET leverages the dependency injection (DI) framework. By injecting an ILogger<T> into your classes or services, you can log information, warnings, errors, and other levels of messages conveniently.
Here is an example:
public class MyClass
{
private readonly ILogger<MyClass> _logger;
public MyClass(ILogger<MyClass> logger)
{
_logger = logger;
}
...
}Nomirun Host uses Serilog to output to console and implements an OpenTelemetry NuGet to output logs, metrics and traces to the storage of your choice. To access these, you can use any relevant tools such as Seq (logs), Jaeger (traces), and Prometheus (metrics).
Nomirun Host has a known Serilog configuration defined in its configuration:
{
"Nomirun.Host": {
"Serilog": {
"Using": [
"Serilog.Sinks.Console"
],
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft": "Debug",
"System": "Debug"
}
}
},
...
}
}You can easily configure the log levels in the configuration to suite your needs:
Verbose but still includes detailed app flow and state information.To set up an OpenTelemetry (OTel) Collector Docker image and configure its integration with the Nomrun host you need to define the Otel.HostUrl configuration which connects to the OTel Collector to the Nomirun Host.
Make sure the Nomrun Host configuration is updated to connect to the OTel Collector. For example:
{
"Nomirun.Host": {
"Otel": {
"HostUrl": "http://otel-collector:4317"
}
}
}HostUrl: Replace otel-collector.localhost with the hostname or IP address of your machine if needed.