Is it possible to do something like this with log4net logging ?
logger.Debug("username : {0} password : {1} server : {2}",username,server,password)
Or am i only left with the option of ugly "+"
concatenating.
Is log4net thread-safe? Yes, log4net is thread-safe.
Yes you can, in two ways
log.Debug(String.format("username : {0} password : {1} server : {2}",username,server,password));
Or use default API
logger.DebugFormat("username : {0} password : {1} server : {2}",username,server,password)
You can also use the new string interpolation feature of C# 6.0:
logger.Debug($"username : {username} password : {password} server : {server}")
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