Skip to content

Level column length #540

Closed
Closed
@cremor

Description

@cremor

Please clearly describe what the SQL Sink is doing incorrectly:

If I use the "autoCreateSqlDatabase": true setting, the [Level] column is created as NVARCHAR (MAX), although the readme says it's nvarchar(128) here and here.

Please clearly describe the expected behavior:

The auto created table should match the readme.

List the names and versions of all Serilog packages used in the project:

  • Serilog: 3.1.1
  • Serilog.AspNetCore: 8.0.1
  • Serilog.Extensions.Hosting: 8.0.0
  • Serilog.Settings.Configuration: 8.0.0
  • Serilog.Sinks.Async: 1.5.0
  • Serilog.Sinks.Console: 5.0.1
  • Serilog.Sinks.Debug: 2.0.0
  • Serilog.Sinks.File: 5.0.0
  • Serilog.Sinks.MSSqlServer: 6.6.1

Target framework and operating system:

.NET 8
OS: Windows 10

Provide a simple reproduction of your Serilog configuration code:

builder.Host.UseSerilog((context, services, loggerConfiguration) => loggerConfiguration.ReadFrom.Configuration(context.Configuration));

Provide a simple reproduction of your Serilog configuration file, if any:

"Serilog": {
  "Using": [ "Common" ],
  "MinimumLevel": {
    "Default": "Information",
    "Override": {
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "WriteTo": {
    "DbSink": {
      "Name": "MSSqlServer",
      "Args": {
        "connectionString": "DefaultConnection",
        "sinkOptionsSection": {
          "tableName": "Logs",
          "autoCreateSqlTable": true
        }
      }
    }
  }
}

Provide a simple reproduction of your application code:

Just start the app to let the log table creation happen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions