diff --git a/FastTunnel.Client/FastTunnel.Client.csproj b/FastTunnel.Client/FastTunnel.Client.csproj
index 908cb94..57fa4d8 100644
--- a/FastTunnel.Client/FastTunnel.Client.csproj
+++ b/FastTunnel.Client/FastTunnel.Client.csproj
@@ -13,8 +13,7 @@
-
-
+
@@ -25,8 +24,8 @@
Always
-
- PreserveNewest
+
+ Always
diff --git a/FastTunnel.Client/Program.cs b/FastTunnel.Client/Program.cs
index 1f79601..ee1f3f0 100644
--- a/FastTunnel.Client/Program.cs
+++ b/FastTunnel.Client/Program.cs
@@ -1,14 +1,5 @@
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using System;
-using System.IO;
-using FastTunnel.Core.Services;
-using Microsoft.Extensions.Hosting;
-using FastTunnel.Core.Client;
-using FastTunnel.Core.Config;
-using FastTunnel.Core.Handlers.Client;
+using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
-using NLog.Web;
using FastTunnel.Core.Extensions;
namespace FastTunnel.Client
@@ -17,22 +8,7 @@ namespace FastTunnel.Client
{
public static void Main(string[] args)
{
- var logger = NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger();
- try
- {
- CreateHostBuilder(args).Build().Run();
- }
- catch (Exception exception)
- {
- //NLog: catch setup errors
- logger.Error(exception, "Stopped program because of exception");
- throw;
- }
- finally
- {
- // Ensure to flush and stop internal timers/threads before application-exit (Avoid segmentation fault on Linux)
- NLog.LogManager.Shutdown();
- }
+ CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
@@ -47,7 +23,7 @@ namespace FastTunnel.Client
{
logging.ClearProviders();
logging.SetMinimumLevel(LogLevel.Trace);
- })
- .UseNLog(); // NLog: Setup NLog for Dependency injection
+ logging.AddLog4Net();
+ });
}
}
diff --git a/FastTunnel.Client/log4net.config b/FastTunnel.Client/log4net.config
new file mode 100644
index 0000000..9fd5229
--- /dev/null
+++ b/FastTunnel.Client/log4net.config
@@ -0,0 +1,72 @@
+
+
+
+
+ Value of priority may be ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/FastTunnel.Client/nlog.config b/FastTunnel.Client/nlog.config
deleted file mode 100644
index 53b543a..0000000
--- a/FastTunnel.Client/nlog.config
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/FastTunnel.Core/FastTunnel.Core.csproj b/FastTunnel.Core/FastTunnel.Core.csproj
index 9f07668..efcce92 100644
--- a/FastTunnel.Core/FastTunnel.Core.csproj
+++ b/FastTunnel.Core/FastTunnel.Core.csproj
@@ -44,8 +44,6 @@
-
-
diff --git a/FastTunnel.Core/Logger/NlogConfig.cs b/FastTunnel.Core/Logger/NlogConfig.cs
deleted file mode 100644
index a945d62..0000000
--- a/FastTunnel.Core/Logger/NlogConfig.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using NLog;
-using NLog.Config;
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace FastTunnel.Core.Logger
-{
- public class NlogConfig
- {
- public static LoggingConfiguration getNewConfig()
- {
- var config = new LoggingConfiguration();
-
- // Targets where to log to: File and Console
- var logfile = new NLog.Targets.FileTarget("file")
- {
- FileName = "${basedir}/Logs/${shortdate}.${level}.log",
- Layout = "${longdate} ${logger} ${message}${exception:format=ToString}"
- };
-
- var logconsole = new NLog.Targets.ConsoleTarget("console")
- {
- Layout = "${date}|${level:uppercase=true}|${message} ${exception} ${all-event-properties}"
- };
-
- // Rules for mapping loggers to targets
- config.AddRule(LogLevel.Debug, LogLevel.Fatal, logconsole);
- config.AddRule(LogLevel.Debug, LogLevel.Fatal, logfile);
-
- return config;
- }
- }
-}
diff --git a/FastTunnel.Server/FastTunnel.Server.csproj b/FastTunnel.Server/FastTunnel.Server.csproj
index 71bcb70..25afaf4 100644
--- a/FastTunnel.Server/FastTunnel.Server.csproj
+++ b/FastTunnel.Server/FastTunnel.Server.csproj
@@ -6,21 +6,10 @@
true
-
-
-
-
-
-
- PreserveNewest
-
-
-
-
-
+
diff --git a/FastTunnel.Server/Program.cs b/FastTunnel.Server/Program.cs
index f236317..ba7ea1b 100644
--- a/FastTunnel.Server/Program.cs
+++ b/FastTunnel.Server/Program.cs
@@ -5,7 +5,6 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
-using NLog.Web;
using System;
namespace FastTunnel.Server
@@ -14,22 +13,7 @@ namespace FastTunnel.Server
{
public static void Main(string[] args)
{
- var logger = NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger();
- try
- {
- CreateHostBuilder(args).Build().Run();
- }
- catch (Exception exception)
- {
- //NLog: catch setup errors
- logger.Error(exception, "Stopped program because of exception");
- throw;
- }
- finally
- {
- // Ensure to flush and stop internal timers/threads before application-exit (Avoid segmentation fault on Linux)
- NLog.LogManager.Shutdown();
- }
+ CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
@@ -58,7 +42,7 @@ namespace FastTunnel.Server
{
logging.ClearProviders();
logging.SetMinimumLevel(LogLevel.Trace);
- })
- .UseNLog(); // NLog: Setup NLog for Dependency injection
+ logging.AddLog4Net();
+ });
}
}
diff --git a/FastTunnel.Server/config/appsettings.json b/FastTunnel.Server/config/appsettings.json
index b3bf791..7aa775a 100644
--- a/FastTunnel.Server/config/appsettings.json
+++ b/FastTunnel.Server/config/appsettings.json
@@ -15,7 +15,7 @@
"BindPort": 1271,
// ×Ô¶¨ÒåÓòÃûweb´©Í¸±ØÐë
- "WebDomain": "my.com",
+ "WebDomain": "test.cc",
// ·þÎñ¼àÌýµÄ¶Ë¿ÚºÅ, ·ÃÎÊ×Ô¶¨ÒåÓòÃûÕ¾µãʱurlΪ http://{SubDomain}.{Domain}:{ProxyPort_HTTP}/
// web´©Í¸±ØÐë
diff --git a/FastTunnel.Server/log4net.config b/FastTunnel.Server/log4net.config
new file mode 100644
index 0000000..9fd5229
--- /dev/null
+++ b/FastTunnel.Server/log4net.config
@@ -0,0 +1,72 @@
+
+
+
+
+ Value of priority may be ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/FastTunnel.Server/nlog.config b/FastTunnel.Server/nlog.config
deleted file mode 100644
index 53b543a..0000000
--- a/FastTunnel.Server/nlog.config
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file