Logging¶
Protocol function¶
Protocol or log functions work similarly to COMOS, but you must use bin\Comos.Web.Worker.exe.config and not bin\Comos.exe.config. As this file is located on the server, logging settings can only be changed there.
Protocol function for the web page¶
In both configuration files "<Build-Path>\Web\web.config" and "<Build- Path>\ComosServices\ComosGateway\Hosting\Web.config" the following lines have to be set to active:
<add key="serilog:write-to:File.path" value="D:\Logs\log.txt" />
<add key="serilog:write-to:File.outputTemplate" value="[{Timestamp:o} {Level:u3} {ProcessId:D6} {ThreadId:D6} {MachineName} {ServiceName} {ServiceVersion}] {Message:lj} || {Properties} {NewLine}"/>
<add key="serilog:write-to:Elasticsearch.nodeUris" value="http://localhost:9200"/>
<add key="serilog:write-to:Elasticsearch.indexFormat" value="comosindex-{0:yyyy.MM}"/>-->
And under \<appSettings>:
<add key="serilog:minimum-level" value="Verbose"/>
Warning
Verbose logging should be used with care.