NLog has a method ILogger.Error(Exception, String,Object[]) See Ref.
What kind of layout renderer can I use to log the args Object[]?
Alternatively, is there any other way to log all local variables?
The args Object[] will be included in the message as format string arguments.
So NLog calls string.Format(message, args) where messages is your log message and args are the "fillers" in that message.
Then this formatted message can be accessed with the ${message} layout render to include in your logs.
I'm not aware of any automatic logging of local variables so you need to pass them manually to the Error method using the args parameter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With