【问题标题】:Logging Application Block 6.0 text formatter template tokens记录应用程序块 6.0 文本格式化程序模板令牌
【发布时间】:2023-03-27 10:50:01
【问题描述】:

我需要可以在 Enterprise Library Loggin Application Block 文本格式化程序配置中使用的文本格式化程序模板令牌列表。

【问题讨论】:

    标签: c# logging token formatter


    【解决方案1】:

    我找到了可用于格式化日志条目的标记列表,这里是:

    {message}
    {category}
    {priority}
    {eventid}
    {severity}
    {title}
    {timestamp}
    {timestamp()}
    {timestamp(local)}
    {timestamp(FixedFormatUSDate)}
    {timestamp(FixedFormatISOInternationalDate)}
    {timestamp(FixedFormatTime)}
    {machine}
    {localMachine}
    {appDomain}
    {localAppDomain}
    {processId}
    {localProcessId}
    {processName}
    {localProcessName}
    {threadName}
    {win32ThreadId}
    {dictionary()}
    {keyvalue()}
    {newline}
    {tab}
    {property()}
    

    字典示例:{dictionary({key} - {value}{newline})}

    List是从Logging Application Block源码中提取的,可以到here下载

    【讨论】:

    • 适用于 Ent.Lib 5.0?如何添加我的海关值,例如 HttpCurrent.User.Identity.Name
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-11-19
    • 2011-03-27
    • 2012-05-17
    • 2011-01-27
    • 2012-05-29
    • 2021-10-03
    相关资源
    最近更新 更多