|
|
|
@ -780,7 +780,7 @@ namespace v2rayN
|
|
|
|
|
task.Settings.RunOnlyIfIdle = false;
|
|
|
|
|
task.Settings.IdleSettings.StopOnIdleEnd = false;
|
|
|
|
|
task.Settings.ExecutionTimeLimit = TimeSpan.Zero;
|
|
|
|
|
task.Triggers.Add(new LogonTrigger { UserId = logonUser, Delay = TimeSpan.FromMinutes(1) });
|
|
|
|
|
task.Triggers.Add(new LogonTrigger { UserId = logonUser, Delay = TimeSpan.FromSeconds(10) });
|
|
|
|
|
task.Principal.RunLevel = TaskRunLevel.Highest;
|
|
|
|
|
task.Actions.Add(new ExecAction(deamonFileName));
|
|
|
|
|
|
|
|
|
@ -1152,17 +1152,23 @@ namespace v2rayN
|
|
|
|
|
|
|
|
|
|
public static void SaveLog(string strContent)
|
|
|
|
|
{
|
|
|
|
|
var logger = LogManager.GetLogger("Log1");
|
|
|
|
|
logger.Info(strContent);
|
|
|
|
|
if (LogManager.IsLoggingEnabled())
|
|
|
|
|
{
|
|
|
|
|
var logger = LogManager.GetLogger("Log1");
|
|
|
|
|
logger.Info(strContent);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public static void SaveLog(string strTitle, Exception ex)
|
|
|
|
|
{
|
|
|
|
|
var logger = LogManager.GetLogger("Log2");
|
|
|
|
|
logger.Debug($"{strTitle},{ex.Message}");
|
|
|
|
|
logger.Debug(ex.StackTrace);
|
|
|
|
|
if (ex?.InnerException != null)
|
|
|
|
|
if (LogManager.IsLoggingEnabled())
|
|
|
|
|
{
|
|
|
|
|
logger.Error(ex.InnerException);
|
|
|
|
|
var logger = LogManager.GetLogger("Log2");
|
|
|
|
|
logger.Debug($"{strTitle},{ex.Message}");
|
|
|
|
|
logger.Debug(ex.StackTrace);
|
|
|
|
|
if (ex?.InnerException != null)
|
|
|
|
|
{
|
|
|
|
|
logger.Error(ex.InnerException);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|