c# - Define multiple sinks with different outputTemplates based on logging level in xml config for Serilog -


is there way define multiple sinks in xml config serilog allow outputtemplate change based on level of log?

i have:

    <add key="serilog:minimum-level" value="verbose" />     <add key="serilog:write-to:coloredconsole" />     <add key="serilog:write-to:rollingfile.pathformat" value="c:\logs\adapterservice-{date}.txt" />     <add key="serilog:write-to:rollingfile.retainedfilecountlimit" value="10" />     <add key="serilog:write-to:rollingfile.outputtemplate" value="[{timestamp:g}] [{level}] [{sourcecontext:l}] {message}{newline:l}{exception:l}" /> 

however debug level logs not include sourcecontext string in:

    <add key="serilog:write-to:rollingfile.outputtemplate" value="[{timestamp:g}] [{level}] {message}{newline:l}{exception:l}" /> 

i aware can set restrictedtominimumlevel: logeventlevel.verbose unsure how in xml.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -