Log4net记录日志的时候一直有错误,代码:
logger.InfoFormat("timestamp:{0},nonce:{1},sign:{2},body:{3}", timestamp, nonce, sign, body);
报错:
<log4net.Error>Exception during StringFormat: 输入字符串的格式不正确。 <format>Trade:{"txId":"","tradeId":"841330603222630400","address":"0xf0D84CC7ea9C415f7017bf6AA8F7C171be0dEd5B","mainCoinType":"60","coinType":"60","amount":"194313000000000000.000000","tradeType":2,"status":2,"fee":"0","decimals":18,"businessId":"1927","memo":""}</format><args>{}</args></log4net.Error>
搞不清楚哪里报的错误
最佳解决方案
可以考虑使用logger.Info()方法或者 确保参数timestamp, nonce, sign, body的值不包含大括号 {、}