1. 雪花ID使用配置项
2. 使用自定义日志格式 3. 修复数据模型和新建流程的bug
This commit is contained in:
@@ -24,6 +24,7 @@ using System.Xml;
|
||||
using System;
|
||||
using System.Text;
|
||||
using Top.Api;
|
||||
using JNPF.Common.Security;
|
||||
|
||||
namespace JNPF.API.Entry;
|
||||
|
||||
@@ -207,6 +208,8 @@ public class Startup : AppStartup
|
||||
endpoints.MapControllerRoute(name: "default", pattern: "{controller=Home}/{action=Index}/{id?}");
|
||||
});
|
||||
|
||||
SnowflakeIdHelper.InitYitIdWorker();
|
||||
|
||||
serviceProvider.GetRequiredService<ITimeTaskService>().StartTimerJob();
|
||||
}
|
||||
|
||||
@@ -226,7 +229,13 @@ public class Startup : AppStartup
|
||||
}
|
||||
private string LoggerFileFormat(LogMessage msg)
|
||||
{
|
||||
return $"{LoggerLevelName(msg.LogLevel)} {msg.LogDateTime.ToString(DATEFORMAT)} {msg.ThreadId}# {msg.Message}";
|
||||
var txt = $"{LoggerLevelName(msg.LogLevel)} {msg.LogDateTime.ToString(DATEFORMAT)} {msg.ThreadId}# {msg.Message}";
|
||||
if (msg.Exception != null)
|
||||
{
|
||||
//var EXCEPTION_SEPARATOR_WITHCOLOR = AppendWithColor(default, EXCEPTION_SEPARATOR, logLevelColors).ToString();
|
||||
txt += $"{Environment.NewLine}{msg.Exception}";
|
||||
}
|
||||
return txt;
|
||||
}
|
||||
private string LoggerConsoleFormat(LogMessage msg)
|
||||
{
|
||||
@@ -236,7 +245,12 @@ public class Startup : AppStartup
|
||||
LogLevel.Error => "\u001b[1m\u001b[31m",
|
||||
_ => "\u001b[39m\u001b[22m"
|
||||
};
|
||||
return $"{fclr}{LoggerLevelName(msg.LogLevel)}\u001b[49m \u001b[36m{msg.LogDateTime.ToString(DATEFORMAT)}\u001b[49m \u001b[39m\u001b[22m{msg.ThreadId}#\u001b[49m {fclr}{msg.Message}\u001b[49m";
|
||||
var txt = $"{fclr}{LoggerLevelName(msg.LogLevel)}\u001b[49m \u001b[36m{msg.LogDateTime.ToString(DATEFORMAT)}\u001b[49m \u001b[39m\u001b[22m{msg.ThreadId}#\u001b[49m {fclr}{msg.Message}\u001b[49m";
|
||||
if (msg.Exception != null)
|
||||
{
|
||||
//var EXCEPTION_SEPARATOR_WITHCOLOR = AppendWithColor(default, EXCEPTION_SEPARATOR, logLevelColors).ToString();
|
||||
txt += $"{Environment.NewLine}{fclr}{msg.Exception}\u001b[49m";
|
||||
}
|
||||
return txt;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user