Totallytech.LogService 1.0.2.14
Central Log System README
This README provides instructions on configuring a central log system in your ASP.NET Core application based on the specified location.
LogConfig Structure
The LogConfig structure defines the configuration settings for the central log system. Depending on the specified location, different configurations may be required.
"LogConfig": {
"Location": "Seq",
"LogFilePath": "/logs",
"ServiceName": "Your Service Name",
"LogEventLevel": 2,
"SqlServerConnectionString": "",
"SeqConfiguration": {
"ServerUrl": "",
"ApiKey": "",
"HasMetrics":false,
"otlpExporters":[
{
"Endpoint": "",
"Protocol": "grpc",
"Headers": "",
}
]]
},
"RabbitMQConfig": {
"HostName": "",
"UserName": "",
"Password": "",
"VirtualHost": "/",
"Port": 5671,
"SslEnabled": false,
"ServerName": "",
"QueueName": ""
},
"ElasticConfiguration": {
"Uri": ""
}
}
Enable Tracing use Code in .net8 or later
builder.Service.AddTracing(IHostApplicationBuilder builder, IConfiguration configuration);
🔐 OTLP Exporter Headers Examples
| Backend | Header Example |
|---|---|
| Honeycomb | x-honeycomb-team=your-api-key |
| New Relic | api-key=YOUR_API_KEY |
| Grafana Cloud | Authorization=Basic <base64 encoded user:token> |
| Elastic APM | Authorization=Bearer YOUR_TOKEN |
Protocol: Protocol used for otlpExporters. Possible values:
http/protobufgrpc
Location: Location of the central log system. Possible values:
SeqFileRabbitMQSqlServerElasticDb
LogEventLevel: LogEventLevel of the central log system. Possible values (use numeric value default is Information (2)):
0 ->Verbose1 ->Debug2 ->Information3 ->Warning4 ->Error5 -> Fatal
LogFilePath: Path where log files are stored (if applicable).
ServiceName: Name of your service.
LogEventLevel: Level where log Event Level are defined (if applicable).
SqlServerConnectionString: Connection string for SQL Server logging (if applicable).
SeqConfiguration: Configuration for Seq logging (if applicable).
RabbitMQConfig: Configuration for RabbitMQ logging (if applicable).
ElasticConfiguration: Configuration for Elasticsearch logging (if applicable).
Serilog Configuration
Use the provided middleware and setup in your application to configure Serilog with the specified settings.
builder.Host.UseSerilog((context, loggerConfiguration) =>
Logging.Library.Extensions.SeriLogger.Configure(context, loggerConfiguration));
Additional Middleware
Add middleware to log HTTP session information.
app.UseSerilogHttpSessionsLogging(HttpSessionInfoToLog.All);
Logging Response Body
If you want to log response bodies, set AllowGetResponse to true.
Conclusion
By following the steps outlined in this README and configuring the central log system based on the specified location, you can effectively manage and monitor logs for your ASP.NET Core application. This centralized logging approach helps streamline log management and enhances visibility into application behavior and performance.
No packages depend on Totallytech.LogService.
.NET 6.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Serilog.Extensions.Logging (>= 8.0.0)
- Serilog.Extensions.Hosting (>= 8.0.0)
- Serilog.Enrichers.Thread (>= 3.1.0)
- Serilog.Enrichers.Environment (>= 2.2.0)
- Serilog.AspNetCore (>= 8.0.1)
- Serilog (>= 3.1.1)
- OpenTelemetry.Instrumentation.StackExchangeRedis (>= 1.11.0-beta.2)
- OpenTelemetry.Instrumentation.Runtime (>= 1.11.1)
- OpenTelemetry.Instrumentation.Http (>= 1.11.1)
- OpenTelemetry.Instrumentation.GrpcNetClient (>= 1.11.0-beta.2)
- OpenTelemetry.Instrumentation.EntityFrameworkCore (>= 1.11.0-beta.2)
- OpenTelemetry.Instrumentation.ElasticsearchClient (>= 1.0.0-beta.5)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.11.1)
- OpenTelemetry.Extensions.Hosting (>= 1.11.2)
- OpenTelemetry.Instrumentation.Quartz (>= 1.11.0-beta.2)
- Serilog.Settings.Configuration (>= 8.0.0)
- Serilog.Sinks.Console (>= 5.0.1)
- Serilog.Sinks.Elasticsearch (>= 8.4.1)
- Serilog.Sinks.Seq (>= 7.0.1)
- Serilog.Sinks.RabbitMQ (>= 7.0.2)
- Serilog.Sinks.Postgresql.Alternative (>= 4.0.4)
- Serilog.Sinks.OpenTelemetry (>= 1.2.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.11.2)
.NET 8.0
- OpenTelemetry.Instrumentation.ElasticsearchClient (>= 1.0.0-beta.5)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.11.1)
- OpenTelemetry.Extensions.Hosting (>= 1.11.2)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.11.2)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- OpenTelemetry.Instrumentation.EntityFrameworkCore (>= 1.11.0-beta.2)
- OpenTelemetry.Instrumentation.GrpcNetClient (>= 1.11.0-beta.2)
- OpenTelemetry.Instrumentation.Http (>= 1.11.1)
- OpenTelemetry.Instrumentation.Quartz (>= 1.11.0-beta.2)
- Serilog.Sinks.Seq (>= 7.0.1)
- Serilog.Sinks.RabbitMQ (>= 7.0.2)
- Serilog.Sinks.Postgresql.Alternative (>= 4.0.4)
- Serilog.Sinks.OpenTelemetry (>= 1.2.0)
- Serilog.Sinks.Elasticsearch (>= 8.4.1)
- Serilog.Sinks.Console (>= 5.0.1)
- Serilog.Settings.Configuration (>= 8.0.0)
- Serilog.Extensions.Logging (>= 8.0.0)
- Serilog.Extensions.Hosting (>= 8.0.0)
- Serilog.Enrichers.Thread (>= 3.1.0)
- Serilog.Enrichers.Environment (>= 2.2.0)
- Serilog.AspNetCore (>= 8.0.1)
- Serilog (>= 3.1.1)
- OpenTelemetry.Instrumentation.StackExchangeRedis (>= 1.11.0-beta.2)
- OpenTelemetry.Instrumentation.Runtime (>= 1.11.1)
.NET 7.0
- Serilog.Sinks.Seq (>= 7.0.1)
- Serilog.Sinks.RabbitMQ (>= 7.0.2)
- Serilog.Sinks.OpenTelemetry (>= 1.2.0)
- Serilog.Sinks.Elasticsearch (>= 8.4.1)
- Serilog.Sinks.Console (>= 5.0.1)
- Serilog.Settings.Configuration (>= 8.0.0)
- Serilog.Extensions.Logging (>= 8.0.0)
- Serilog.Extensions.Hosting (>= 8.0.0)
- Serilog.Sinks.Postgresql.Alternative (>= 4.0.4)
- Serilog.Enrichers.Thread (>= 3.1.0)
- Serilog.AspNetCore (>= 8.0.1)
- Serilog.Enrichers.Environment (>= 2.2.0)
- Serilog (>= 3.1.1)
- OpenTelemetry.Instrumentation.StackExchangeRedis (>= 1.11.0-beta.2)
- OpenTelemetry.Instrumentation.Runtime (>= 1.11.1)
- OpenTelemetry.Instrumentation.Quartz (>= 1.11.0-beta.2)
- OpenTelemetry.Instrumentation.Http (>= 1.11.1)
- OpenTelemetry.Instrumentation.GrpcNetClient (>= 1.11.0-beta.2)
- OpenTelemetry.Instrumentation.EntityFrameworkCore (>= 1.11.0-beta.2)
- OpenTelemetry.Instrumentation.ElasticsearchClient (>= 1.0.0-beta.5)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.11.1)
- OpenTelemetry.Extensions.Hosting (>= 1.11.2)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.11.2)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
| Version | Downloads | Last updated |
|---|---|---|
| 1.0.2.20 | 62 | 7/16/2025 |
| 1.0.2.19 | 57 | 5/10/2025 |
| 1.0.2.18 | 9 | 5/10/2025 |
| 1.0.2.17 | 11 | 5/1/2025 |
| 1.0.2.16 | 14 | 4/30/2025 |
| 1.0.2.15 | 11 | 4/30/2025 |
| 1.0.2.14 | 12 | 4/30/2025 |
| 1.0.2.13 | 8 | 4/30/2025 |
| 1.0.2.12 | 12 | 4/30/2025 |
| 1.0.2.11 | 10 | 4/30/2025 |
| 1.0.2.10 | 12 | 4/29/2025 |
| 1.0.2.9 | 52 | 4/12/2025 |
| 1.0.2.8 | 11 | 4/12/2025 |
| 1.0.2.7 | 12 | 4/12/2025 |
| 1.0.2.6 | 7 | 4/12/2025 |
| 1.0.2.5 | 12 | 4/12/2025 |
| 1.0.2.4 | 16 | 2/20/2025 |
| 1.0.2.3 | 91 | 9/15/2024 |
| 1.0.2.2 | 39 | 6/15/2024 |
| 1.0.2.1 | 12 | 6/13/2024 |
| 1.0.2 | 87 | 6/9/2024 |
| 1.0.1 | 74 | 5/29/2024 |
| 1.0.0 | 77 | 5/26/2024 |