Table of Contents

Serilog

Neos uses Serilog as logging library. By default, messages are written in the console and optionally in Application Insights.

If you need to see internal commands executed during the database migration, you can follow this specific guide.

Serilog configuration is read in configuration in the default Serilog section.

The default configuration in our appsetttings.json looks like this in development mode:

{
  "Serilog": {
    "MinimumLevel": {
      "Default": "Information",
      "Override": {
        "Microsoft": "Warning",
        "Microsoft.Hosting.Lifetime": "Information",
        "Microsoft.AspNetCore.Hosting.Diagnostics": "Error",
        "Yarp.ReverseProxy.Forwarder.HttpForwarder": "Error",
        "Microsoft.AspNetCore": "Warning",
        "Yarp": "Warning",
        "Finbuckle": "Warning",
        "GroupeIsa.Neos.ServerProxy.MultiTenant": "Warning"
      }
    }
  }
}
Note

Available values for log levels are :

  • Verbose: This is the lowest level and will log everything. It's typically used for tracing and can be very detailed.
  • Debug: This level is used for internal system events that are not necessarily observable from the outside, but useful when determining how something happened.
  • Information: This level is used to track the general flow of the application.
  • Warning: This level is used for events that could potentially cause issues.
  • Error: This level is used to log errors and exceptions that occur in the application.
  • Fatal: This level is used to log critical errors that result in the termination of the application.

You can override the default logging levels with environment variables.

For example, if you want information messages from Microsoft namespace, you can create the following environment variable (example in PowerShell):

${env:Serilog__MinimumLevel__Override__Microsoft} = "Information"

Entity Framework Core

Currently, only information, warning and error logs sent by EF Core are forwarded to Serilog. All logs emitted by EF Core are in namespaces nested in Microsoft.EntityFrameworkCore namespace but as our default configuration filters logs from the Microsoft namespace at the 'Warning' level, information logs from EF Core will not appear by default.

To obtain the information-level logs issued by EF Core, you can create the following environment variable (example in PowerShell):

${env:Serilog__MinimumLevel__Override__Microsoft.EntityFrameworkCore} = "Information"

To customize logs emitted by EF Core, you can use EFCoreWarnings in cluster configuration.

Default log level on neos command

The neos command provides a directive for setting the default minimum log level.

Example to set the default level to debug on a setup command:

neos [log:debug] setup

The allowed values are verbose, debug, information, warning, error and fatal.

Note

The previous example is equivalent to setting the following environment variable (example in PowerShell):

${env:Serilog__MinimumLevel} = "Debug"