mirror of
https://github.com/FastTunnel/FastTunnel.git
synced 2025-02-08 02:39:29 +08:00
增加几行日志
This commit is contained in:
parent
ab29a062ff
commit
0b4883f162
|
@ -21,6 +21,7 @@ namespace FastTunnel.Client
|
|||
{
|
||||
LogManager.LoadConfiguration("Nlog.config");
|
||||
var logger = LogManager.GetCurrentClassLogger();
|
||||
logger.Debug("===== Sevice Start =====");
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -70,7 +70,14 @@ namespace FastTunnel.Core
|
|||
private void ReceiveCustomer(object state)
|
||||
{
|
||||
var client = state as Socket;
|
||||
handler.Invoke(client, _data);
|
||||
try
|
||||
{
|
||||
handler.Invoke(client, _data);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logerr.LogError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public void ShutdownAndClose()
|
||||
|
|
|
@ -79,8 +79,9 @@ namespace FastTunnel.Core.Server
|
|||
client.Close();
|
||||
return;
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex);
|
||||
throw;
|
||||
}
|
||||
|
||||
|
@ -256,6 +257,8 @@ namespace FastTunnel.Core.Server
|
|||
// listen success
|
||||
SSHList.Add(item.RemotePort, new SSHInfo<SSHHandlerArg> { Listener = ls, Socket = client, SSHConfig = item });
|
||||
_logger.LogDebug($"SSH proxy success: {item.RemotePort} -> {item.LocalIp}:{item.LocalPort}");
|
||||
|
||||
client.Send(new Message<string> { MessageType = MessageType.Info, Content = $"TunnelForSSH is OK: {requet.ClientConfig.Common.ServerAddr}:{item.RemotePort}->{item.LocalIp}:{item.LocalPort}" });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -264,8 +267,6 @@ namespace FastTunnel.Core.Server
|
|||
client.Send(new Message<string> { MessageType = MessageType.Error, Content = ex.Message });
|
||||
continue;
|
||||
}
|
||||
|
||||
client.Send(new Message<string> { MessageType = MessageType.Info, Content = $"TunnelForSSH is OK: {requet.ClientConfig.Common.ServerAddr}:{item.RemotePort}->{item.LocalIp}:{item.LocalPort}" });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ namespace FastTunnel.Server
|
|||
{
|
||||
LogManager.LoadConfiguration("Nlog.config");
|
||||
var logger = LogManager.GetCurrentClassLogger();
|
||||
logger.Debug("===== Sevice Start =====");
|
||||
|
||||
try
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user