2025-08-17 12:09:41 +00:00
|
|
|
namespace ServiceLib.Services.CoreConfig;
|
|
|
|
|
|
|
|
|
|
public partial class CoreConfigV2rayService
|
|
|
|
|
{
|
2026-02-06 04:55:55 +00:00
|
|
|
private void GenLog()
|
2025-08-17 12:09:41 +00:00
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2026-02-06 04:55:55 +00:00
|
|
|
var config = context.AppConfig;
|
|
|
|
|
if (config.CoreBasicItem.LogEnabled)
|
2025-08-17 12:09:41 +00:00
|
|
|
{
|
|
|
|
|
var dtNow = DateTime.Now;
|
2026-02-06 04:55:55 +00:00
|
|
|
_coreConfig.log.loglevel = config.CoreBasicItem.Loglevel;
|
|
|
|
|
_coreConfig.log.access = Utils.GetLogPath($"Vaccess_{dtNow:yyyy-MM-dd}.txt");
|
|
|
|
|
_coreConfig.log.error = Utils.GetLogPath($"Verror_{dtNow:yyyy-MM-dd}.txt");
|
2025-08-17 12:09:41 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2026-02-06 04:55:55 +00:00
|
|
|
_coreConfig.log.loglevel = config.CoreBasicItem.Loglevel;
|
|
|
|
|
_coreConfig.log.access = null;
|
|
|
|
|
_coreConfig.log.error = null;
|
2025-08-17 12:09:41 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
Logging.SaveLog(_tag, ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|