@@ -216,7 +216,7 @@ namespace Shadowsocks.Controller | |||||
} | } | ||||
catch (Exception e) | catch (Exception e) | ||||
{ | { | ||||
logger.Debug("config changed asynchrously, just ignore this server"); | |||||
logger.Debug(e,"config changed asynchrously, just ignore this server"); | |||||
} | } | ||||
} | } | ||||
@@ -20,8 +20,18 @@ namespace Shadowsocks.Model | |||||
Debug, | Debug, | ||||
Trace, | Trace, | ||||
} | } | ||||
const string NLOG_CONFIG_FILE_NAME = "NLog.config"; | |||||
private static string _NLOG_CONFIG_FILE_NAME=string.Empty; | |||||
public static string NLOG_CONFIG_FILE_NAME | |||||
{ | |||||
get | |||||
{ | |||||
if (_NLOG_CONFIG_FILE_NAME.IsNullOrEmpty()) | |||||
{ | |||||
_NLOG_CONFIG_FILE_NAME = Path.Combine(Environment.CurrentDirectory, "NLog.config"); | |||||
} | |||||
return _NLOG_CONFIG_FILE_NAME; | |||||
} | |||||
} | |||||
const string TARGET_MIN_LEVEL_ATTRIBUTE = "minlevel"; | const string TARGET_MIN_LEVEL_ATTRIBUTE = "minlevel"; | ||||
const string LOGGER_FILE_NAME_ATTRIBUTE = "fileName"; | const string LOGGER_FILE_NAME_ATTRIBUTE = "fileName"; | ||||
@@ -108,6 +118,7 @@ namespace Shadowsocks.Model | |||||
/// </summary> | /// </summary> | ||||
public static void TouchAndApplyNLogConfig() | public static void TouchAndApplyNLogConfig() | ||||
{ | { | ||||
if (!File.Exists(NLOG_CONFIG_FILE_NAME)) | if (!File.Exists(NLOG_CONFIG_FILE_NAME)) | ||||
{ | { | ||||
File.WriteAllText(NLOG_CONFIG_FILE_NAME, Properties.Resources.NLog_config); | File.WriteAllText(NLOG_CONFIG_FILE_NAME, Properties.Resources.NLog_config); | ||||
@@ -10,9 +10,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121. | |||||
<TargetFramework>netcoreapp3.1</TargetFramework> | <TargetFramework>netcoreapp3.1</TargetFramework> | ||||
<PublishDir>bin\Release\netcoreapp3.1\publish\</PublishDir> | <PublishDir>bin\Release\netcoreapp3.1\publish\</PublishDir> | ||||
<RuntimeIdentifier>win-x86</RuntimeIdentifier> | <RuntimeIdentifier>win-x86</RuntimeIdentifier> | ||||
<SelfContained>true</SelfContained> | |||||
<PublishSingleFile>False</PublishSingleFile> | |||||
<PublishReadyToRun>True</PublishReadyToRun> | |||||
<PublishTrimmed>True</PublishTrimmed> | |||||
<SelfContained>false</SelfContained> | |||||
<PublishSingleFile>True</PublishSingleFile> | |||||
<PublishReadyToRun>False</PublishReadyToRun> | |||||
</PropertyGroup> | </PropertyGroup> | ||||
</Project> | </Project> |