1
저는 EnterpriseLibrary.Logging을 처음 사용합니다. 의 Web.config에서 loggingConfiguration에서, 우리는 포매터를 다음과 같은 한 : 코드에서loggingConfiguration에 대한 포맷터를 사용자 정의하는 방법은 무엇입니까?
<formatters>
<add name="Default Formatter" template="
Timestamp: {timestamp(local)}

Message: {message}

Category: {category}

Priority: {priority}

EventId: {eventid}

Severity: {severity}

Title:{title}

Machine: {machine}

Application Domain: {appDomain}

Process Id: {processId}

Process Name: {processName}

Win32 Thread Id: {win32ThreadId}

Thread Name: {threadName}

User Name: {userName}

 extended Properties: {dictionary({key} - {value}
)}"
type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="DBA Formatter" template="
Timestamp: {timestamp(local)}

Message: {message}

Category: {category}

Priority: {priority}

EventId: {eventid}

Severity: {severity}

Title:{title}

Machine: {machine}

Extended Properties: {dictionary({key} - {value}
)}"
type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</formatters>
을 뒤에, 우리는 단지 LogEntry에 메시지를 설정합니다. 나는 다른 사람들이 어떻게 설정했는지 궁금하다. 예를 들어 타임 스탬프, 카테고리, 우선 순위 등등. 나는 사용자 이름을 추가했지만 작동하지 않는다. 아무도 내게 어떤 빛을 비추 수 있습니까?