[성현모] Socket 응답 추가
This commit is contained in:
@ -72,8 +72,6 @@ namespace SystemX.Core.Communication
|
||||
|
||||
public void Start(Socket socket)
|
||||
{
|
||||
Log4net.WriteLine("Session Start");
|
||||
|
||||
_socket = socket;
|
||||
|
||||
_recvArgs.Completed += new EventHandler<SocketAsyncEventArgs>(OnRecvCompleted);
|
||||
|
||||
@ -23,6 +23,7 @@ public enum LogType
|
||||
|
||||
HTTP = 20,
|
||||
SOCKET = 21,
|
||||
CONTROLLER = 22,
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -32,12 +33,14 @@ public static class Log4netCustomLevel
|
||||
public static readonly log4net.Core.Level DB = new log4net.Core.Level(10010, LogType.DB.ToString());
|
||||
public static readonly log4net.Core.Level HTTP = new log4net.Core.Level(10020, LogType.HTTP.ToString());
|
||||
public static readonly log4net.Core.Level SOCKET = new log4net.Core.Level(10021, LogType.SOCKET.ToString());
|
||||
public static readonly log4net.Core.Level CONTROLLER = new log4net.Core.Level(10022, LogType.CONTROLLER.ToString());
|
||||
|
||||
public static void SetCustomLevel(ILoggerRepository repo)
|
||||
{
|
||||
repo.LevelMap.Add(DB);
|
||||
repo.LevelMap.Add(HTTP);
|
||||
repo.LevelMap.Add(SOCKET);
|
||||
repo.LevelMap.Add(CONTROLLER);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@ -56,9 +59,11 @@ public static class Log4net
|
||||
{
|
||||
string log4netConfigPath = @"../Config/log4net.config";
|
||||
|
||||
if (File.Exists(log4netConfigPath) == false)
|
||||
if (File.Exists(log4netConfigPath) == true)
|
||||
{
|
||||
Console.WriteLine($"create log4netConfig: {log4netConfigPath}");
|
||||
File.Delete(log4netConfigPath);
|
||||
|
||||
Console.WriteLine($"Create log4netConfig: {log4netConfigPath}");
|
||||
File.WriteAllText(log4netConfigPath, Config);
|
||||
}
|
||||
|
||||
@ -152,6 +157,15 @@ public static class Log4net
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LogType.CONTROLLER:
|
||||
{
|
||||
Type? t = MethodBase.GetCurrentMethod()?.DeclaringType;
|
||||
if (t != null)
|
||||
{
|
||||
Manager?.Logger.Log(t, Log4netCustomLevel.CONTROLLER, log, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,6 +224,10 @@ public static class Log4net
|
||||
<level value=""SOCKET"" />
|
||||
<foreColor value=""DarkCyan"" />
|
||||
</mapping>
|
||||
<mapping>
|
||||
<level value=""CONTROLLER"" />
|
||||
<foreColor value=""DarkGreen"" />
|
||||
</mapping>
|
||||
</appender>
|
||||
|
||||
<appender name=""file"" type=""log4net.Appender.RollingFileAppender"">
|
||||
|
||||
Reference in New Issue
Block a user