# Configuration for Serilog
# This is the yaml equivalent of this https://github.com/serilog/serilog-settings-configuration
# For more see https://openmod.github.io/openmod-docs/userdoc/concepts/logging
Serilog:
  Using:
  - Serilog
  - Serilog.Sinks.Console
  - Serilog.Sinks.File
  - Serilog.Sinks.Async
  WriteTo:
  - Name: Async
    Args:
      configure:
      - Name: Console
        Args:
          theme: "Serilog.Sinks.SystemConsole.Themes.SystemConsoleTheme::Literate, Serilog.Sinks.Console"
          outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}][{SourceContext}] {Message:lj}{NewLine}{Exception}"
      - Name: File
        Args:
          path: "{{workingDirectory}}/logs/openmod-{{date}}.log"
          outputTemplate: "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}][{SourceContext}] {Message:lj}{NewLine}{Exception}"
  Enrich:
  - FromLogContext
  MinimumLevel:
    Default: Information
    Override:
      # You can configure when specific events should be logged
      # In this example, the Microsoft.EntityFrameworkCore events below are only logged if Warning or higher
      Microsoft.EntityFrameworkCore.Database.Command: Warning
      Microsoft.EntityFrameworkCore.Infrastructure: Warning
      Microsoft.EntityFrameworkCore.Database.Connection: Warning
      Microsoft.EntityFrameworkCore.Query: Warning
      # In case of verbose logging we still might want to have the event bus disabled as it spams a lot of logs
      OpenMod.Core.Eventing.EventBus: Information