|
|
@@ -20,8 +20,18 @@ namespace Shadowsocks.Model |
|
|
|
Debug,
|
|
|
|
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 LOGGER_FILE_NAME_ATTRIBUTE = "fileName";
|
|
|
|
|
|
|
@@ -108,6 +118,7 @@ namespace Shadowsocks.Model |
|
|
|
/// </summary>
|
|
|
|
public static void TouchAndApplyNLogConfig()
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!File.Exists(NLOG_CONFIG_FILE_NAME))
|
|
|
|
{
|
|
|
|
File.WriteAllText(NLOG_CONFIG_FILE_NAME, Properties.Resources.NLog_config);
|
|
|
|