Does by default OrmLite logs all Sql queries to the Console at the Debug level?
I have a console app (not a ss service) using OrmLite and all the queries are logged at the Debug level. I’m using Serilog.
Here is my appsettings file:
{
"Serilog": {
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft": "Warning",
"System": "Warning",
"Microsoft.AspNetCore": "Warning"
}
}
}
}
The config builder etc.:
IConfigurationBuilder builder = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonAppSettingsBasedOnAspNetCoreEnvironment()
.AddEnvironmentVariables();
IConfiguration configuration = builder.Build();
var logger = new LoggerConfiguration()
.ReadFrom.Configuration(configuration)
.WriteTo.Console(_opts.ConsoleSinkMinimumLevel)
.WriteTo.File(logFilePath, _opts.FileSinkMinimumLevel, rollingInterval: RollingInterval.Day)
.CreateLogger();
LogManager.LogFactory = new SerilogFactory(logger);
Log = LogManager.GetLogger(typeof(Program));
Is there a way to switch this off and on with a flag?
Thanks.