수색…


nlog.config에서 내부 로거 사용

문제가 발생하면 내부 로거를 사용하도록 설정하십시오.

<nlog internalLogFile="c:\log.txt" internalLogLevel="Trace">
   <targets>
      <!-- target configuration here -->
   </targets>
   <rules>
      <!-- log routing rules -->
   </rules>
</nlog>

프로그래밍 방식으로 내부 로거 사용

문제가 발생하면 내부 로거를 사용하십시오.

C # 예제 :

// set internal log level
InternalLogger.LogLevel = LogLevel.Trace;

// enable one of the targets: file, console, logwriter:

//  enable internal logging to a file (absolute or relative path. Don't use layout renderers)
InternalLogger.LogFile = "c:\\log.txt";

// enable internal logging to the console
InternalLogger.LogToConsole = true;

// enable internal logging to the console (error stream)
InternalLogger.LogToConsoleError = true

// enable internal logging to the Trace
InternalLogger.LogToTrace = true

// enable internal logging to a custom TextWriter
InternalLogger.LogWriter = new StringWriter(); //e.g. TextWriter writer = File.CreateText("C:\\perl.txt")


Modified text is an extract of the original Stack Overflow Documentation
아래 라이선스 CC BY-SA 3.0
와 제휴하지 않음 Stack Overflow