我正在写一个程序,我在里面使用了NLog。我有几个类,在所有的类中我都有一个属性
public string DeviceName { get; set; }
我想让记录器把这个放在我的日志消息前面,例如,如果我有两个类
class A
{
public DeviceName {get;set;} = "HMP20"
public void methodOne()
{
logger.Info("Something");
}
}
class B
{
public DeviceName {get;set
使用NLOG4.4.5am,尝试使用协议JsonPost of WebService目标发布日志以松弛日志。松懈的webhooks需要Json数据,而不是https post ()
<target xsi:type="WebService"
name="slack"
url="https://hooks.slack.com/services/T*****/B4T****/7F********XDv9h/"
protocol="JsonPost"