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.
You can use it like this:
public class MyClass
{
private readonly ILogger<MyClass> _logger;
public MyClass(ILogger<MyClass> logger)
{
_logger = logger;
}
...
}
Nomirun Host is using Serilog to output to console and implements OpenTelemetry
NuGet to output logs
, metrics
and
traces
to the storage of your choice. For logs, you can use Seq
, for traces you can use Jaeger
and for metrics you
can use Prometheus
.
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, follow the steps below. This includes defining the Otel.HostUrl
configuration to connect the OTel Collector to the Nomrun 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.