iconDreamine
← 목록

Dreamine.Logging

stablev1.0.2

구조화된 로깅 코어 — ILogSink, LogEntry, 파일/메모리 싱크 포함.

#diagnostics#dreamine#formatter#infrastructure#logger#logging#sink
TFM net8.0Package Dreamine.Logging참조 Dreamine.MVVM.Core

Dreamine.Logging

Dreamine.Logging은 Dreamine 애플리케이션을 위한 핵심 로그 인프라 패키지입니다. Logger 추상화, 구조화된 로그 엔트리, 메모리 진단 저장소, 텍스트 포매터, 복합 Sink, 일자별 텍스트 파일 출력, 그리고 고빈도 멀티스레드 로그 처리를 위한 비동기 큐 Sink를 제공합니다.

➡️ English Version

목적

이 패키지는 Dreamine 기반 애플리케이션에서 사용하는 UI 비의존 로그 Core 계층입니다. 로그 생성과 로그 출력을 분리하여, 호출 쓰레드가 파일 I/O나 UI 갱신 비용에 직접 묶이지 않도록 설계되었습니다.

Dreamine.Logging은 WPF 또는 특정 UI 프레임워크를 참조하면 안 됩니다. WPF 전용 로그 패널은 Dreamine.Logging.Wpf 패키지가 담당합니다.

주요 기능

  • IDreamineLogger 추상화
  • 기본 Logger 구현체 DreamineLogger
  • Trace, Debug, Info, Warning, Error, Fatal 로그 레벨
  • 구조화된 로그 모델 DreamineLogEntry
  • 출력 대상 확장을 위한 IDreamineLogSink
  • 여러 Sink에 동시에 기록하는 CompositeLogSink
  • 제한된 백그라운드 큐 기반 비차단 로그 처리를 위한 AsyncQueueSink
  • 런타임 진단 및 UI 연동을 위한 Bounded Ring Buffer 저장소 InMemoryLogStore (기본 capacity 1000, O(1) 용량 관리)
  • 일반 텍스트 변환을 위한 DreamineTextLogFormatter
  • 버퍼링 및 제어된 Flush를 지원하는 일자별 파일 Sink TextFileLogSink
  • AsyncQueueSink.ShutdownAsync(...) 기반 종료 시 Flush 처리

권장 구조

기본 등록 API는 Sink 체인을 구성하고 종료 시 사용할 비동기 dispose handle을 반환합니다. 이 구조는 작업 쓰레드가 파일 I/O 또는 UI 표시용 저장소 갱신 때문에 직접 지연되는 것을 막습니다.

Application threads
  -> IDreamineLogger
     -> DreamineLogger
        -> AsyncQueueSink
           -> CompositeLogSink
              ├─► InMemoryLogStore   (LogAdded 이벤트 발행)
              └─► TextFileLogSink

DreamineLogPanelViewModel은 이 체인의 일부가 아닙니다. ViewModel은 InMemoryLogStore.LogAdded 이벤트를 구독하는 별도 Observer 입니다. WPF 표시 계층 흐름은 Dreamine.Logging.Wpf 문서를 참고하십시오.

AsyncQueueSink가 필요한 이유

로그 시스템은 쓰레드 루프, 백그라운드 Worker, 통신 처리기, Motion/IO Polling Job, UI Command 등 다양한 위치에서 호출됩니다. 로그 호출마다 파일에 직접 쓰거나 UI 표시용 저장소를 즉시 갱신하면 호출 쓰레드가 지연될 수 있습니다. 로그가 지속적으로 발생하면 Dispatcher 작업 또는 표시용 로그 컬렉션이 과도하게 누적될 수도 있습니다.

AsyncQueueSink는 이 중 호출 쓰레드 지연 문제를 해결합니다.

  • 생산자는 로그 엔트리를 빠르게 큐에 넣습니다.
  • 하나의 백그라운드 Worker가 큐를 소비합니다.
  • 큐는 capacity로 상한을 가집니다.
  • 큐가 가득 차면 호출자를 블락하지 않고 가장 오래된 대기 로그를 드롭합니다 (BoundedChannelFullMode.DropOldest).
  • 드롭된 누적 개수는 AsyncQueueSink.DroppedCount 프로퍼티로 모니터링할 수 있습니다.
  • 종료 시 대기 로그를 최대한 비우고 종료할 수 있습니다.

WPF 표시 컬렉션의 상한 및 UI Dispatcher 배치 처리는 Dreamine.Logging.Wpf가 담당합니다.

등록 예시

아래 등록 방식은 Logger는 단순하게 유지하고, 비동기 처리는 Sink 체인에 위임하는 구조입니다.

private static IAsyncDisposable? _loggingShutdown;

private static void RegisterLogging()
{
    _loggingShutdown = DreamineLoggingRegistration.Register(new DreamineLoggingOptions
    {
        Category = "SampleSmart",
        LogDirectory = Path.Combine(AppContext.BaseDirectory, "Logs")
    });
}

종료 처리

비동기 등록 handle을 사용할 경우 애플리케이션 종료 시 dispose 하여 큐를 비우는 처리가 필요합니다. 최근 로그 손실을 줄이고, 내부 Sink 체인과 파일 핸들을 정상적으로 정리하기 위한 목적입니다.

protected override void OnExit(ExitEventArgs e)
{
    try
    {
        _loggingShutdown?.DisposeAsync().AsTask().GetAwaiter().GetResult();
    }
    catch
    {
        // 종료 중 로그 오류가 애플리케이션 종료를 막으면 안 됩니다.
    }
    finally
    {
        base.OnExit(e);
    }
}

OnExit은 동기 메서드이므로 async void 대신 GetAwaiter().GetResult()로 대기해야 프로세스가 큐 Flush 완료 전에 종료되는 것을 막을 수 있습니다.

로그 파일 출력

TextFileLogSink를 사용하면 로그는 날짜별 파일로 저장됩니다.

Logs/yyyy-MM-dd.log

예시:

[2026-05-09 18:30:22.718] [Info] [SampleSmart] [T1] Application initialized.

TextFileLogSink는 매 로그마다 파일을 열고 닫지 않고 현재 날짜의 파일을 열어둔 상태로 기록합니다. 설정된 쓰기 횟수마다 Flush하며, Error 이상 로그는 즉시 Flush합니다.

스레드 안전성

DreamineLogger, AsyncQueueSink, CompositeLogSink, InMemoryLogStore, TextFileLogSink는 애플리케이션 단위 단일 인스턴스로 공유 사용함을 전제로 합니다. 권장 등록 방식은 애플리케이션당 Logger 1개, Async Sink 1개, Sink 체인 1개입니다.

TextFileLogSinkInMemoryLogStore는 내부 lock으로 보호되므로 AsyncQueueSink 없이 직접 멀티스레드에서 호출해도 thread-safe합니다. 다만 호출 쓰레드 블로킹을 피하려면 큐를 통해 사용하는 것이 좋습니다.

고빈도 루프에서는 운영 코드에서 매 Cycle 로그를 남기지 않는 것이 좋습니다. 권장 로그 지점은 다음과 같습니다.

  • 상태 변경 시점
  • Warning 또는 Error 발생 시점
  • 작업 시작/종료 시점
  • 진단 모드
  • 주기 제한된 로그 출력

주의 사항

  • IDreamineLoggerAsyncQueueSink가 포함된 Sink 체인을 사용하는 DreamineLogger로 등록합니다.
  • 외부 Consumer가 IDreamineLogSink를 직접 Resolve할 수 있다면 AsyncQueueSink를 등록하는 편이 안전합니다.
  • Logger의 sink 목록과 CompositeLogSink의 children에 같은 Sink 인스턴스를 중복 추가하지 마십시오. 동일 로그가 두 번 기록됩니다.
  • 이 패키지에는 WPF UI 컴포넌트를 넣지 않습니다.
  • 화면 표시용 로그 패널은 Dreamine.Logging.Wpf를 사용합니다.

Dreamine.Logging.Wpf와의 관계

Dreamine.Logging.Wpf
  -> Dreamine.Logging

의존성 방향은 반드시 단방향으로 유지합니다. Dreamine.Logging은 Core 계층이고, Dreamine.Logging.Wpf는 표시 계층 Adapter입니다.

향후 계획

  • DreamineLoggerOptions (capacity, batch size, file directory 등 옵션을 한 객체로 통합)
  • DMContainer.UseDreamineLogging(...) (위 등록 보일러플레이트를 한 줄로 줄이는 확장 메서드)
  • DreamineLogger에 단일 Sink + Level + Category 편의 생성자 추가
  • 로그 파일 롤링 정책 (일자 외에도 크기/개수 기준)
  • Database Sink
  • 외부 로그 서비스 Sink
  • AsyncQueueSink의 Drop 로그 보고 Hook (이벤트 기반 알림)
  • 선택적 로그 Throttling Helper

라이선스

MIT License

구조 다이어그램

classDiagram
    class IDreamineLogger {
        <<interface>>
        +Debug(string) void
        +Info(string) void
        +Warning(string) void
        +Error(string, Exception) void
        +Fatal(string, Exception) void
        +Flush() Task
    }
    class DreamineLogger {
        -IList~ILogSink~ _sinks
        +Debug(string) void
        +Info(string) void
        +Warning(string) void
        +Error(string, Exception) void
        +Fatal(string, Exception) void
        +Flush() Task
        +AddSink(ILogSink) DreamineLogger
    }
    class ILogSink {
        <<interface>>
        +Write(LogEntry) void
        +Flush() Task
    }
    class FileSink {
        -string _path
        -long _maxBytes
        +Write(LogEntry) void
        +Flush() Task
        -RollFile() void
    }
    class ConsoleSink {
        +Write(LogEntry) void
        +Flush() Task
    }
    class LogEntry {
        +LogLevel Level
        +string Message
        +DateTime Timestamp
        +Exception? Exception
        +string? Category
    }
    IDreamineLogger <|.. DreamineLogger
    DreamineLogger o-- ILogSink
    ILogSink <|.. FileSink
    ILogSink <|.. ConsoleSink
    DreamineLogger --> LogEntry

API 문서

타입

AsyncQueueSink

\if KO 동기 로그 출력을 제한된 백그라운드 큐로 감쌉니다. \endif \if EN Decorates a synchronous log sink with a bounded background queue. \endif

CompositeLogSink

\if KO 로그 항목을 여러 출력에 전달합니다. \endif \if EN Writes log entries to multiple log sinks. \endif

DreamineLogEntry

\if KO 하나의 Dreamine 로그 항목을 나타냅니다. \endif \if EN Represents a single Dreamine log entry. \endif

DreamineLogger

\if KO 기본 Dreamine 로거 구현을 제공합니다. \endif \if EN Provides the default Dreamine logger implementation. \endif

DreamineLoggingOptions

\if KO Dreamine 로깅 등록 구성 옵션을 제공합니다. \endif \if EN Provides configuration options for Dreamine logging registration. \endif

DreamineLoggingRegistration

\if KO Dreamine 로깅 서비스 등록 도우미를 제공합니다. \endif \if EN Provides registration helpers for Dreamine logging services. \endif

DreamineLogLevel

\if KO Dreamine 로그 항목의 심각도 수준을 정의합니다. \endif \if EN Defines the severity level of a Dreamine log entry. \endif

DreamineTextLogFormatter

\if KO Dreamine 로그 항목을 일반 텍스트로 변환합니다. \endif \if EN Formats Dreamine log entries as plain text. \endif

IDreamineLogFormatter

\if KO Dreamine 로그 항목을 텍스트로 변환하는 포맷터를 정의합니다. \endif \if EN Defines a formatter that converts a Dreamine log entry to text. \endif

IDreamineLogger

\if KO Dreamine 구성 요소에서 사용하는 기본 로깅 API를 정의합니다. \endif \if EN Defines the main logging API used by Dreamine components. \endif

IDreamineLogSink

\if KO 로그 출력 대상을 정의합니다. \endif \if EN Defines a log output target. \endif

IDreamineLogStore

\if KO UI 또는 진단에서 읽을 수 있는 로그 저장소를 정의합니다. \endif \if EN Defines a readable log store used by UI or diagnostics. \endif

InMemoryLogStore

\if KO 제한된 링 버퍼를 사용해 Dreamine 로그 항목을 메모리에 저장합니다. \endif \if EN Stores Dreamine log entries in memory using a bounded ring buffer. \endif

LoggingShutdownHandle

\if KO 비동기 로그 출력을 제한 시간 내 종료하는 핸들입니다. \endif \if EN Represents a handle that shuts down an asynchronous log sink within a timeout. \endif

TextFileLogSink

\if KO Dreamine 로그 항목을 날짜별 텍스트 로그 파일에 기록합니다. \endif \if EN Writes Dreamine log entries to daily text log files. \endif

AsyncQueueSink

#ctor Method

\if KO 내부 출력과 큐 설정으로 를 초기화합니다. \endif \if EN Initializes with an inner sink and queue settings. \endif

inner— \if KO 항목을 전달할 동기 출력입니다. \endif \if EN The synchronous sink that receives entries. \endif
capacity— \if KO 최대 대기 항목 수입니다. \endif \if EN The maximum number of pending entries. \endif
drainBatchSize— \if KO 내부 출력과 큐 설정으로 를 초기화합니다. \endif \if EN Initializes with an inner sink and queue settings. \endif
Dispose Method

\if KO 기본 제한 시간으로 큐를 동기 종료하고 오류를 억제합니다. \endif \if EN Shuts down the queue synchronously with the default timeout while suppressing errors. \endif

DisposeAsync Method

\if KO 기본 제한 시간으로 큐를 종료하고 리소스를 비동기 해제합니다. \endif \if EN Shuts down the queue with the default timeout and releases resources asynchronously. \endif

반환: \if KO 비동기 해제 작업입니다. \endif \if EN The asynchronous disposal operation. \endif

RunAsync Method

\if KO 큐를 배치 단위로 비우고 내부 출력에 전달하는 전용 워커를 실행합니다. \endif \if EN Runs the dedicated worker that drains the queue in batches into the inner sink. \endif

반환: \if KO 워커 수명 작업입니다. \endif \if EN The worker lifetime task. \endif

ShutdownAsync Method

\if KO 새 항목 수락을 중지하고 대기 항목이 처리될 때까지 기다립니다. \endif \if EN Stops accepting new entries and waits for pending entries to drain. \endif

timeout— \if KO 워커 종료를 기다릴 최대 시간입니다. \endif \if EN The maximum time to wait for the worker. \endif

반환: \if KO 비동기 종료 작업입니다. \endif \if EN The asynchronous shutdown operation. \endif

Write Method

\if KO 로그 항목을 비차단 방식으로 백그라운드 큐에 추가합니다. \endif \if EN Enqueues a log entry on the background queue without blocking. \endif

entry— \if KO 추가할 로그 항목입니다. \endif \if EN The log entry to enqueue. \endif
DroppedCount Property

\if KO 큐가 가득 차서 버려진 항목 수를 가져옵니다. \endif \if EN Gets the number of entries dropped because the queue was full. \endif

_channel Field

\if KO channel 값을 보관합니다. \endif \if EN Stores the channel value. \endif

_cts Field

\if KO cts 값을 보관합니다. \endif \if EN Stores the cts value. \endif

_disposed Field

\if KO disposed 값을 보관합니다. \endif \if EN Stores the disposed value. \endif

_drainBatchSize Field

\if KO drain Batch Size 값을 보관합니다. \endif \if EN Stores the drain batch size value. \endif

_droppedCount Field

\if KO dropped Count 값을 보관합니다. \endif \if EN Stores the dropped count value. \endif

_inner Field

\if KO inner 값을 보관합니다. \endif \if EN Stores the inner value. \endif

_workerTask Field

\if KO worker Task 값을 보관합니다. \endif \if EN Stores the worker task value. \endif

CompositeLogSink

#ctor Method

\if KO 지정한 출력 시퀀스로 를 초기화합니다. \endif \if EN Initializes with the specified sinks. \endif

sinks— \if KO 로그 출력 시퀀스입니다. \endif \if EN The log sinks. \endif
Dispose Method

\if KO 을 구현한 모든 내부 출력을 해제합니다. \endif \if EN Disposes inner sinks that implement . \endif

Write Method

\if KO 항목을 모든 내부 출력에 기록하며 출력별 실패를 격리합니다. \endif \if EN Writes an entry to all inner sinks while isolating individual failures. \endif

entry— \if KO 기록할 항목입니다. \endif \if EN The entry to write. \endif
_disposed Field

\if KO disposed 값을 보관합니다. \endif \if EN Stores the disposed value. \endif

_sinks Field

\if KO sinks 값을 보관합니다. \endif \if EN Stores the sinks value. \endif

DreamineLogEntry

#ctor Method

\if KO 클래스의 새 인스턴스를 초기화합니다. \endif \if EN Initializes a new instance of the class. \endif

timestamp— \if KO 생성 시각입니다. \endif \if EN The creation time. \endif
level— \if KO 심각도 수준입니다. \endif \if EN The severity level. \endif
category— \if KO 로그 범주이며 비어 있으면 Dreamine이 사용됩니다. \endif \if EN The log category; Dreamine is used when empty. \endif
message— \if KO 로그 메시지이며 이면 빈 문자열이 사용됩니다. \endif \if EN The log message; an empty string is used when . \endif
exception— \if KO 연결된 예외입니다. \endif \if EN The associated exception. \endif
threadId— \if KO 관리 스레드 ID입니다. \endif \if EN The managed thread ID. \endif
Category Property

\if KO 로그 범주를 가져옵니다. \endif \if EN Gets the log category. \endif

DisplayText Property

\if KO 간단한 UI 보기에서 사용할 표시 텍스트를 가져옵니다. \endif \if EN Gets the display text used by simple UI views. \endif

Exception Property

\if KO 로그 항목과 연결된 예외를 가져옵니다. \endif \if EN Gets the exception associated with the log entry. \endif

Level Property

\if KO 로그 항목의 심각도 수준을 가져옵니다. \endif \if EN Gets the severity level of the log entry. \endif

Message Property

\if KO 로그 메시지를 가져옵니다. \endif \if EN Gets the log message. \endif

ThreadId Property

\if KO 로그 항목이 생성된 관리 스레드 ID를 가져옵니다. \endif \if EN Gets the managed thread ID where the log entry was created. \endif

Timestamp Property

\if KO 로그 항목이 생성된 시각을 가져옵니다. \endif \if EN Gets the time when the log entry was created. \endif

TimestampText Property

\if KO 서식이 적용된 타임스탬프 텍스트를 가져옵니다. \endif \if EN Gets the formatted timestamp text. \endif

DreamineLogger

#ctor Method

\if KO 단일 출력으로 를 초기화합니다. \endif \if EN Initializes with a single sink. \endif

sink— \if KO 로그 출력입니다. \endif \if EN The log sink. \endif
#ctor Method

\if KO 단일 출력과 범주로 를 초기화합니다. \endif \if EN Initializes with a single sink and category. \endif

sink— \if KO 로그 출력입니다. \endif \if EN The log sink. \endif
category— \if KO 로그 범주입니다. \endif \if EN The log category. \endif
#ctor Method

\if KO 단일 출력, 최소 수준 및 범주로 를 초기화합니다. \endif \if EN Initializes with a single sink, minimum level, and category. \endif

sink— \if KO 로그 출력입니다. \endif \if EN The log sink. \endif
minimumLevel— \if KO 최소 기록 수준입니다. \endif \if EN The minimum log level. \endif
category— \if KO 로그 범주입니다. \endif \if EN The log category. \endif
#ctor Method

\if KO 여러 출력, 최소 수준 및 범주로 를 초기화합니다. \endif \if EN Initializes with multiple sinks, a minimum level, and a category. \endif

sinks— \if KO 로그 출력 시퀀스입니다. \endif \if EN The log sinks. \endif
minimumLevel— \if KO 최소 기록 수준입니다. \endif \if EN The minimum log level. \endif
category— \if KO 로그 범주입니다. \endif \if EN The log category. \endif
Debug Method

\if KO 디버그 수준 메시지를 기록합니다. \endif \if EN Writes a debug-level message. \endif

message— \if KO 메시지입니다. \endif \if EN The message. \endif
Error Method

\if KO 오류 수준 메시지를 기록합니다. \endif \if EN Writes an error-level message. \endif

message— \if KO 메시지입니다. \endif \if EN The message. \endif
Error Method

\if KO 예외와 오류 수준 메시지를 기록합니다. \endif \if EN Writes an exception and error-level message. \endif

exception— \if KO 예외입니다. \endif \if EN The exception. \endif
message— \if KO 메시지입니다. \endif \if EN The message. \endif
Fatal Method

\if KO 치명적 오류 수준 메시지를 기록합니다. \endif \if EN Writes a fatal-level message. \endif

message— \if KO 메시지입니다. \endif \if EN The message. \endif
Fatal Method

\if KO 예외와 치명적 오류 수준 메시지를 기록합니다. \endif \if EN Writes an exception and fatal-level message. \endif

exception— \if KO 예외입니다. \endif \if EN The exception. \endif
message— \if KO 메시지입니다. \endif \if EN The message. \endif
Info Method

\if KO 정보 수준 메시지를 기록합니다. \endif \if EN Writes an information-level message. \endif

message— \if KO 메시지입니다. \endif \if EN The message. \endif
Trace Method

\if KO 추적 수준 메시지를 기록합니다. \endif \if EN Writes a trace-level message. \endif

message— \if KO 메시지입니다. \endif \if EN The message. \endif
Warning Method

\if KO 경고 수준 메시지를 기록합니다. \endif \if EN Writes a warning-level message. \endif

message— \if KO 메시지입니다. \endif \if EN The message. \endif
Write Method

\if KO 최소 수준 이상인 항목을 모든 출력에 기록하며 출력별 실패를 격리합니다. \endif \if EN Writes an entry at or above the minimum level to every sink while isolating sink failures. \endif

entry— \if KO 기록할 로그 항목입니다. \endif \if EN The log entry to write. \endif
Write Method

\if KO 현재 시각과 스레드 정보로 로그 항목을 만들어 기록합니다. \endif \if EN Creates and writes a log entry with the current time and thread information. \endif

level— \if KO 로그 수준입니다. \endif \if EN The log level. \endif
message— \if KO 로그 메시지입니다. \endif \if EN The log message. \endif
exception— \if KO 선택적 예외입니다. \endif \if EN The optional exception. \endif
_category Field

\if KO category 값을 보관합니다. \endif \if EN Stores the category value. \endif

_minimumLevel Field

\if KO minimum Level 값을 보관합니다. \endif \if EN Stores the minimum level value. \endif

_sinks Field

\if KO sinks 값을 보관합니다. \endif \if EN Stores the sinks value. \endif

DreamineLoggingOptions

Category Property

\if KO 로그 범주 이름을 가져오거나 설정합니다. \endif \if EN Gets or sets the log category name. \endif

DrainBatchSize Property

\if KO 한 배치에서 처리할 항목 수를 가져오거나 설정합니다. \endif \if EN Gets or sets the number of entries drained per batch. \endif

FlushEveryWriteCount Property

\if KO 텍스트 파일 출력을 flush하기 전 기록 횟수를 가져오거나 설정합니다. \endif \if EN Gets or sets the number of writes before flushing the text-file sink. \endif

LogDirectory Property

\if KO 로그 디렉터리 경로를 가져오거나 설정합니다. \endif \if EN Gets or sets the log directory path. \endif

QueueCapacity Property

\if KO 비동기 큐 용량을 가져오거나 설정합니다. \endif \if EN Gets or sets the asynchronous queue capacity. \endif

ShutdownTimeout Property

\if KO 대기 중 로그를 처리하며 종료할 때 사용할 제한 시간을 가져오거나 설정합니다. \endif \if EN Gets or sets the shutdown timeout used to drain pending log entries. \endif

StoreCapacity Property

\if KO 메모리에 유지할 최대 로그 항목 수를 가져오거나 설정합니다. \endif \if EN Gets or sets the maximum number of log entries kept in memory. \endif

DreamineLoggingRegistration

Register Method

\if KO 구성 작업을 적용해 Dreamine 핵심 로깅 서비스를 등록합니다. \endif \if EN Registers Dreamine core logging services after applying a configuration action. \endif

configure— \if KO 선택적 로깅 구성 작업입니다. \endif \if EN The optional logging configuration action. \endif

반환: \if KO 해제 시 등록된 출력을 비우는 비동기 해제 핸들입니다. \endif \if EN An asynchronous disposal handle that drains the registered sink. \endif

Register Method

\if KO 지정한 옵션으로 Dreamine 핵심 로깅 서비스를 등록합니다. \endif \if EN Registers Dreamine core logging services using the specified options. \endif

options— \if KO 로깅 옵션입니다. \endif \if EN The logging options. \endif

반환: \if KO 해제 시 등록된 출력을 비우는 비동기 해제 핸들입니다. \endif \if EN An asynchronous disposal handle that drains the registered sink. \endif

DreamineLogLevel

Debug Field

\if KO 디버깅 정보입니다. \endif \if EN Debugging information. \endif

Error Field

\if KO 오류 정보입니다. \endif \if EN Error information. \endif

Fatal Field

\if KO 치명적 오류 정보입니다. \endif \if EN Fatal error information. \endif

Info Field

\if KO 일반 정보입니다. \endif \if EN General information. \endif

Trace Field

\if KO 상세 진단 정보입니다. \endif \if EN Detailed diagnostic information. \endif

Warning Field

\if KO 경고 정보입니다. \endif \if EN Warning information. \endif

DreamineTextLogFormatter

Format Method

\if KO 지정한 로그 항목을 타임스탬프, 수준, 범주, 스레드 및 예외가 포함된 텍스트로 변환합니다. \endif \if EN Formats a log entry as text containing its timestamp, level, category, thread, and exception. \endif

entry— \if KO 변환할 로그 항목입니다. \endif \if EN The log entry to format. \endif

반환: \if KO 변환된 로그 텍스트입니다. \endif \if EN The formatted log text. \endif

IDreamineLogFormatter

Format Method

\if KO 지정한 로그 항목을 텍스트로 변환합니다. \endif \if EN Formats the specified log entry. \endif

entry— \if KO 변환할 로그 항목입니다. \endif \if EN The log entry to format. \endif

반환: \if KO 변환된 로그 텍스트입니다. \endif \if EN The formatted log text. \endif

IDreamineLogger

Debug Method

\if KO 디버그 수준 로그 메시지를 기록합니다. \endif \if EN Writes a debug log message. \endif

message— \if KO 로그 메시지입니다. \endif \if EN The log message. \endif
Error Method

\if KO 오류 수준 로그 메시지를 기록합니다. \endif \if EN Writes an error log message. \endif

message— \if KO 로그 메시지입니다. \endif \if EN The log message. \endif
Error Method

\if KO 예외와 함께 오류 수준 로그 메시지를 기록합니다. \endif \if EN Writes an error log message with an exception. \endif

exception— \if KO 기록할 예외입니다. \endif \if EN The exception to log. \endif
message— \if KO 로그 메시지입니다. \endif \if EN The log message. \endif
Fatal Method

\if KO 치명적 오류 수준 로그 메시지를 기록합니다. \endif \if EN Writes a fatal log message. \endif

message— \if KO 로그 메시지입니다. \endif \if EN The log message. \endif
Fatal Method

\if KO 예외와 함께 치명적 오류 수준 로그 메시지를 기록합니다. \endif \if EN Writes a fatal log message with an exception. \endif

exception— \if KO 기록할 예외입니다. \endif \if EN The exception to log. \endif
message— \if KO 로그 메시지입니다. \endif \if EN The log message. \endif
Info Method

\if KO 정보 수준 로그 메시지를 기록합니다. \endif \if EN Writes an information log message. \endif

message— \if KO 로그 메시지입니다. \endif \if EN The log message. \endif
Trace Method

\if KO 추적 수준 로그 메시지를 기록합니다. \endif \if EN Writes a trace log message. \endif

message— \if KO 로그 메시지입니다. \endif \if EN The log message. \endif
Warning Method

\if KO 경고 수준 로그 메시지를 기록합니다. \endif \if EN Writes a warning log message. \endif

message— \if KO 로그 메시지입니다. \endif \if EN The log message. \endif
Write Method

\if KO 구성된 로그 항목을 직접 기록합니다. \endif \if EN Writes a log entry directly. \endif

entry— \if KO 기록할 로그 항목입니다. \endif \if EN The log entry to write. \endif

IDreamineLogSink

Write Method

\if KO 로그 항목을 출력 대상에 기록합니다. \endif \if EN Writes a log entry to the sink. \endif

entry— \if KO 기록할 로그 항목입니다. \endif \if EN The log entry to write. \endif

IDreamineLogStore

Add Method

\if KO 로그 항목을 저장소에 추가합니다. \endif \if EN Adds a log entry to the store. \endif

entry— \if KO 추가할 로그 항목입니다. \endif \if EN The log entry to add. \endif
Clear Method

\if KO 저장된 모든 로그 항목을 지웁니다. \endif \if EN Clears all stored log entries. \endif

GetEntries Method

\if KO 저장된 모든 로그 항목을 가져옵니다. \endif \if EN Gets all stored log entries. \endif

반환: \if KO 저장된 로그 항목의 스냅샷입니다. \endif \if EN A snapshot of stored log entries. \endif

LogAdded Event

\if KO 로그 항목이 추가될 때 발생합니다. \endif \if EN Occurs when a log entry is added. \endif

InMemoryLogStore

#ctor Method

\if KO 기본 용량 1000으로 를 초기화합니다. \endif \if EN Initializes with the default capacity of 1000 entries. \endif

#ctor Method

\if KO 지정한 용량으로 를 초기화합니다. \endif \if EN Initializes with the specified capacity. \endif

capacity— \if KO 유지할 최대 항목 수이며 0 이하면 1000을 사용합니다. \endif \if EN The maximum entry count; 1000 is used when non-positive. \endif
Add Method

\if KO 로그 항목을 추가하고 용량을 초과한 가장 오래된 항목을 제거합니다. \endif \if EN Adds an entry and removes the oldest entries exceeding capacity. \endif

entry— \if KO 추가할 항목입니다. \endif \if EN The entry to add. \endif
Clear Method

\if KO 저장된 모든 로그 항목을 지웁니다. \endif \if EN Clears all stored log entries. \endif

GetEntries Method

\if KO 저장된 로그 항목의 스냅샷을 가져옵니다. \endif \if EN Gets a snapshot of stored log entries. \endif

반환: \if KO 저장 순서의 로그 항목 목록입니다. \endif \if EN The log entries in storage order. \endif

Write Method

\if KO 로그 출력 계약을 통해 항목을 저장소에 추가합니다. \endif \if EN Adds an entry to the store through the log-sink contract. \endif

entry— \if KO 기록할 항목입니다. \endif \if EN The entry to write. \endif
_capacity Field

\if KO capacity 값을 보관합니다. \endif \if EN Stores the capacity value. \endif

_entries Field

\if KO entries 값을 보관합니다. \endif \if EN Stores the entries value. \endif

_syncRoot Field

\if KO sync Root 값을 보관합니다. \endif \if EN Stores the sync root value. \endif

LogAdded Event

\if KO 로그 항목이 추가될 때 발생합니다. \endif \if EN Occurs when a log entry is added. \endif

LoggingShutdownHandle

#ctor Method

\if KO 종료 대상과 제한 시간으로 핸들을 초기화합니다. \endif \if EN Initializes the handle with its sink and timeout. \endif

asyncSink— \if KO 종료할 비동기 출력입니다. \endif \if EN The asynchronous sink to shut down. \endif
shutdownTimeout— \if KO 종료 제한 시간입니다. \endif \if EN The shutdown timeout. \endif
DisposeAsync Method

\if KO 대기 중 로그를 처리하고 출력을 종료합니다. \endif \if EN Drains pending logs and shuts down the sink. \endif

반환: \if KO 비동기 종료 작업입니다. \endif \if EN The asynchronous shutdown operation. \endif

_asyncSink Field

\if KO async Sink 값을 보관합니다. \endif \if EN Stores the async sink value. \endif

_shutdownTimeout Field

\if KO shutdown Timeout 값을 보관합니다. \endif \if EN Stores the shutdown timeout value. \endif

TextFileLogSink

#ctor Method

\if KO 로그 디렉터리, 포맷터 및 flush 주기로 를 초기화합니다. \endif \if EN Initializes with a directory, formatter, and flush interval. \endif

logDirectory— \if KO 로그 디렉터리 경로이며 비어 있으면 Logs를 사용합니다. \endif \if EN The log directory path; Logs is used when empty. \endif
formatter— \if KO 로그 포맷터입니다. \endif \if EN The log formatter. \endif
flushEveryWriteCount— \if KO flush 사이의 기록 횟수이며 0 이하면 20을 사용합니다. 오류 이상은 즉시 flush합니다. \endif \if EN The write count between flushes; 20 is used when non-positive, and errors are always flushed immediately. \endif
Dispose Method

\if KO 대기 중 내용을 flush하고 파일 작성기를 해제합니다. \endif \if EN Flushes pending content and releases the file writer. \endif

EnsureWriter Method

\if KO 지정한 파일 경로를 대상으로 하는 작성기를 준비하고 날짜 변경 시 교체합니다. \endif \if EN Ensures a writer targets the specified path and replaces it after date rollover. \endif

filePath— \if KO 대상 파일 경로입니다. \endif \if EN The target file path. \endif
FlushCore Method

\if KO 현재 작성기의 대기 내용을 파일에 반영하고 기록 카운터를 초기화합니다. \endif \if EN Flushes pending writer content and resets the write counter. \endif

GetFilePath Method

\if KO 로그 디렉터리를 준비하고 타임스탬프에 해당하는 날짜별 파일 경로를 만듭니다. \endif \if EN Ensures the log directory exists and builds the daily file path for a timestamp. \endif

timestamp— \if KO 로그 타임스탬프입니다. \endif \if EN The log timestamp. \endif

반환: \if KO 날짜별 로그 파일 경로입니다. \endif \if EN The daily log file path. \endif

Write Method

\if KO 항목을 해당 날짜 파일에 기록하고 구성된 조건에서 flush합니다. \endif \if EN Writes an entry to its daily file and flushes under the configured conditions. \endif

entry— \if KO 기록할 항목입니다. \endif \if EN The entry to write. \endif
_currentFilePath Field

\if KO current File Path 값을 보관합니다. \endif \if EN Stores the current file path value. \endif

_disposed Field

\if KO disposed 값을 보관합니다. \endif \if EN Stores the disposed value. \endif

_flushEveryWriteCount Field

\if KO flush Every Write Count 값을 보관합니다. \endif \if EN Stores the flush every write count value. \endif

_formatter Field

\if KO formatter 값을 보관합니다. \endif \if EN Stores the formatter value. \endif

_logDirectory Field

\if KO log Directory 값을 보관합니다. \endif \if EN Stores the log directory value. \endif

_pendingFlushCount Field

\if KO pending Flush Count 값을 보관합니다. \endif \if EN Stores the pending flush count value. \endif

_syncRoot Field

\if KO sync Root 값을 보관합니다. \endif \if EN Stores the sync root value. \endif

_writer Field

\if KO writer 값을 보관합니다. \endif \if EN Stores the writer value. \endif

DefaultFlushEveryWriteCount Field

\if KO Default Flush Every Write Count 값을 보관합니다. \endif \if EN Stores the default flush every write count value. \endif