Fix
This commit is contained in:
@@ -1,15 +1,22 @@
|
||||
using Quartz.Logging;
|
||||
using System.Configuration;
|
||||
|
||||
namespace MachineJob
|
||||
{
|
||||
// simple log provider to get something to the console
|
||||
public class ConsoleLogProvider : ILogProvider
|
||||
{
|
||||
private readonly IConfigurationRoot configuration = new ConfigurationBuilder()
|
||||
.SetBasePath(Directory.GetCurrentDirectory())
|
||||
.AddJsonFile("appsettings.json")
|
||||
.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT") ?? "Production"}.json", true)
|
||||
.Build();
|
||||
|
||||
public Logger GetLogger(string name)
|
||||
{
|
||||
return (level, func, exception, parameters) =>
|
||||
{
|
||||
if (func != null)
|
||||
if (level >= configuration.GetSection("Quartz").GetValue<Quartz.Logging.LogLevel>("LogLevel") && func != null)
|
||||
{
|
||||
Console.WriteLine("[" + DateTime.Now.ToLongTimeString() + "] [" + level + "] " + func(), parameters);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace MachineJob
|
||||
|
||||
private static readonly string connectionString = configuration.GetConnectionString("DatabaseWriteConnectionString")!;
|
||||
|
||||
public DbSet<DatabaseWriteEntity> DatabaseWrites { get; set; }
|
||||
public DbSet<DatabaseWriteEntity>? DatabaseWrites { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,21 @@
|
||||
{
|
||||
"Serilog": {
|
||||
"MinimumLevel": {
|
||||
"Default": "Debug"
|
||||
"Default": "Debug",
|
||||
"Override": {
|
||||
"Microsoft": "Debug",
|
||||
"Microsoft.Hosting.Lifetime": "Debug"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Debug",
|
||||
"Microsoft": "Debug",
|
||||
"Microsoft.Hosting.Lifetime": "Debug"
|
||||
}
|
||||
},
|
||||
"Quartz": {
|
||||
"LogLevel": "Debug"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,21 @@
|
||||
{
|
||||
"Serilog": {
|
||||
"MinimumLevel": {
|
||||
"Default": "Error"
|
||||
"Default": "Error",
|
||||
"Override": {
|
||||
"Microsoft": "Error",
|
||||
"Microsoft.Hosting.Lifetime": "Error"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Error",
|
||||
"Microsoft": "Error",
|
||||
"Microsoft.Hosting.Lifetime": "Error"
|
||||
}
|
||||
},
|
||||
"Quartz": {
|
||||
"LogLevel": "Error"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,16 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Information",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"Quartz": {
|
||||
"LogLevel": "Info"
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"DatabaseWriteConnectionString": "Server=127.0.0.1; User ID=root; Password=123456; Database=modbusnettest;"
|
||||
},
|
||||
@@ -216,8 +226,7 @@
|
||||
"Name": "Test10"
|
||||
}
|
||||
],
|
||||
"AddressMapOpc":
|
||||
[
|
||||
"AddressMapOpc": [
|
||||
{
|
||||
"Area": "Random",
|
||||
"Address": "Real4",
|
||||
|
||||
Reference in New Issue
Block a user