c# - How to add ThreadId and ProcessId into the log output for each entry -


is there simple way add threadid , processid logs through microsoft.extensions.logging without writing own loggingprovider?

simply following code

logger.loginformation("this test of emergency broadcast system."); 

should produce following or similar output. (please assume i'm talking consolelogger)

info: [{processid}:{threadid}] test of emergency broadcast system. 
  • for familiar serilog, i'm looking features called output template , defining global property
  • please not suggest third party library

nope, there's nothing built console logger.


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -