feat : 로그 기록 남기기(클라이언트 쪽 패키지 추가), 포매팅, 도커 설정 변경,

This commit is contained in:
qornwh1
2026-03-01 01:30:10 +09:00
parent 97f6187f5d
commit 563448a09a
6 changed files with 14 additions and 5 deletions

View File

@@ -13,6 +13,7 @@
<PackageReference Include="protobuf-net" Version="3.2.56" /> <PackageReference Include="protobuf-net" Version="3.2.56" />
<PackageReference Include="Serilog" Version="4.3.1" /> <PackageReference Include="Serilog" Version="4.3.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" /> <PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -14,9 +14,7 @@ public class DummyClientService
public DummyClientService(int count, string ip, int port, string key, int sendIntervalMs = 1000) public DummyClientService(int count, string ip, int port, string key, int sendIntervalMs = 1000)
{ {
sendInterval = sendIntervalMs; sendInterval = sendIntervalMs;
clients = Enumerable.Range(0, count) clients = Enumerable.Range(0, count).Select(i => new DummyClients(i, ip, port, key)).ToList();
.Select(i => new DummyClients(i, ip, port, key))
.ToList();
Log.Information("[SERVICE] {Count}개 클라이언트 생성 → {Ip}:{Port}", count, ip, port); Log.Information("[SERVICE] {Count}개 클라이언트 생성 → {Ip}:{Port}", count, ip, port);
} }

View File

@@ -10,7 +10,15 @@ class EcoClientTester
private static async Task Main(string[] args) private static async Task Main(string[] args)
{ {
Log.Logger = new LoggerConfiguration().WriteTo.Console().CreateLogger(); // .MinimumLevel.Warning() // Warning 이상만 출력 배포시
string timestamp = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss");
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.Console()
.WriteTo.File($"logs/log_{timestamp}.txt")
.CreateLogger();
CancellationTokenSource cts = new CancellationTokenSource(); CancellationTokenSource cts = new CancellationTokenSource();
Console.CancelKeyPress += (_, e) => Console.CancelKeyPress += (_, e) =>

View File

@@ -1,5 +1,4 @@
using LiteNetLib; using LiteNetLib;
using Serilog;
using ServerLib.Service; using ServerLib.Service;
namespace MMOserver.Game; namespace MMOserver.Game;

View File

@@ -7,6 +7,8 @@ class Program
{ {
private static void Main() private static void Main()
{ {
// .MinimumLevel.Warning() // Warning 이상만 출력 배포시
string timestamp = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"); string timestamp = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss");
Log.Logger = new LoggerConfiguration() Log.Logger = new LoggerConfiguration()

View File

@@ -6,4 +6,5 @@
dockerfile: MMOserver/Dockerfile dockerfile: MMOserver/Dockerfile
ports: ports:
- "9050:9050/udp" # LiteNetLib UDP 포트 - "9050:9050/udp" # LiteNetLib UDP 포트
- "9500:9500/udp" # LiteNetLib UDP 포트
restart: unless-stopped restart: unless-stopped