You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having this same issue (logs on slack only show PID/process name), except I'm configuring the Slack target through code.
varslackTarget=newSlackTarget{// Name = "slackTarget",Layout="${message}",WebHookUrl=configuration.GetSection("JsonConfigurations").GetValue<String>("webHookUrl"),Compact=false,};config.AddTarget("slack",slackTarget);
Whenever I change Compact to true, the actual message content goes through.
I don't seem to have this issue when using nlog.config to configure the Slack target. Unfortunately, I have to use code to configure the target because I'm passing in variables from appsettings.json. So this isn't a viable work-around for me.
@fox-infonote did you try setting the field names inside your nlog.config? Here's my nlog.config that sends the full message content:
Hi, think I have found a small bug with version 2.0
I upgrade and added compact to target setting it to false.
The logs on Slack only showed Process name and PID. Tried removing compact and got the same result.
When I set the compact value to true the layout data appeared with out the Process name and PID.
Had a look at the code and but can't see an obvious cause for this.
My target look like this.
<target xsi:type= "Slack
name="Slack_Warn"
layout="${longdate}|${level:uppercase=true}${Environment} ${logger} ${message} ${exception:format=tostring}"
webHookUrl="https://hooks.slack.com/services/restofurl" compact="true" />
so don't have the fields you show in your example .. is that the issue ?
The text was updated successfully, but these errors were encountered: