修改了日志等级

This commit is contained in:
2025-09-09 16:46:33 +08:00
parent 7fad87fff5
commit e92f5dac5d
5 changed files with 10 additions and 6 deletions

View File

@@ -42,7 +42,7 @@ public interface IDataLoaderService
/// <summary>
/// 异步加载所有日志数据
/// </summary>
Task<List<NlogDto>> LoadAllNlogsAsync();
Task<List<NlogDto>> LoadAllNlogsAsync(int count);
/// <summary>
/// 当数据加载完成时触发

View File

@@ -81,7 +81,7 @@ public class DataLoaderService : IDataLoaderService
var mqttServerDtos = await LoadAllMqttServersAsync();
// 加载所有日志
var nlogDtos = await LoadAllNlogsAsync();
var nlogDtos = await LoadAllNlogsAsync(100);
// 获取变量MQTT别名
var variableMqttAliases = await _repositoryManager.VariableMqttAliases.GetAllAsync();
@@ -191,8 +191,8 @@ public class DataLoaderService : IDataLoaderService
/// <summary>
/// 异步加载所有日志数据
/// </summary>
public async Task<List<NlogDto>> LoadAllNlogsAsync()
public async Task<List<NlogDto>> LoadAllNlogsAsync(int count)
{
return await _nlogAppService.GetAllLogsAsync();
return await _nlogAppService.GetLatestLogsAsync(count);
}
}

View File

@@ -31,11 +31,13 @@ public class DbMqttServer
/// <summary>
/// 用户名
/// </summary>
[SugarColumn(IsNullable = true)]
public string Username { get; set; }
/// <summary>
/// 密码
/// </summary>
[SugarColumn(IsNullable = true)]
public string Password { get; set; }
/// <summary>
@@ -46,11 +48,13 @@ public class DbMqttServer
/// <summary>
/// 订阅的主题
/// </summary>
[SugarColumn(IsNullable = true)]
public string SubscribeTopic { get; set; }
/// <summary>
/// 发布的主题
/// </summary>
[SugarColumn(IsNullable = true)]
public string PublishTopic { get; set; }
/// <summary>

View File

@@ -73,6 +73,6 @@
<logger name="*" minlevel="Trace" writeTo="logconsole"/>
<logger name="*" minlevel="Info" writeTo="logfile"/>
<!-- 路由日志到数据库 -->
<logger name="*" minlevel="Info" writeTo="database"/>
<logger name="*" minlevel="Warning" writeTo="database"/>
</rules>
</nlog>

View File

@@ -5,6 +5,7 @@ using CommunityToolkit.Mvvm.Input;
using DMS.Application.Interfaces;
using DMS.WPF.Services;
using System;
using System.Data;
using System.Threading.Tasks;
using DMS.Application.Services;
using DMS.WPF.Helper;
@@ -46,7 +47,6 @@ public partial class SplashViewModel : ObservableObject
{
try
{
_logger.LogInformation("正在初始化数据库...");
LoadingMessage = "正在初始化数据库...";
_initializeService.InitializeTables();