|
|
@@ -108,11 +108,20 @@ namespace Shadowsocks.Model |
|
|
|
/// </summary>
|
|
|
|
public static void TouchAndApplyNLogConfig()
|
|
|
|
{
|
|
|
|
if (!File.Exists(NLOG_CONFIG_FILE_NAME))
|
|
|
|
try
|
|
|
|
{
|
|
|
|
if (File.Exists(NLOG_CONFIG_FILE_NAME))
|
|
|
|
return; // NLog.config exists, and has already been loaded
|
|
|
|
|
|
|
|
File.WriteAllText(NLOG_CONFIG_FILE_NAME, Properties.Resources.NLog_config);
|
|
|
|
LogManager.LoadConfiguration(NLOG_CONFIG_FILE_NAME);
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
NLog.Common.InternalLogger.Error(ex, "[shadowsocks] Failed to setup default NLog.config: {0}", NLOG_CONFIG_FILE_NAME);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
LoadConfiguration(); // Load the new config-file
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|