我是 EnterpriseLibrary.Logging 的新手。在 web.config 中,在 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。我想知道其他参数是如何设置的,例如时间戳、类别、优先级等。我添加了用户名,但不起作用。任何人都可以对我有所了解吗?