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="Serilog" Version="4.3.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
</ItemGroup>
</Project>

View File

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

View File

@@ -10,7 +10,15 @@ class EcoClientTester
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();
Console.CancelKeyPress += (_, e) =>