I have many of these types of logs generated throughout the application.
_logger.Debug(string.Format(
"Object value is - {0}",
JsonConvert.SerializeObject(someDynamicObject)));
Now when in production, most of the time loglevel would be Error, hence above line would not log anything. The question is whether string.format is called and string operations are being done, or the JIT compiler is smart enough to remove away the whole call depending on log level? If not, then a lot of string operations are happening for no reason, and probably we should optimize these in a better way.