How to setting up Serilog Sink in Identify

We supported a new log store, it is Serilog Sink (ref: https://github.com/serilog/serilog/wiki/AppSettings). There are many Serilog targets, we can find out it here https://github.com/serilog but we just support MSSqlSever so far.

  • To use that log store, we need to change the log target into system setup/logging section to
  • Create a new database in SQL Server, in this example, I created database name: IdentifyLog
  • Add the following keys to web.config of Admin/Runtime (replace the username/password to the correct ones for connection string):

    <add key="serilog:using:MSSqlSever" value="Serilog.Sinks.MSSqlServer" />
    <add key="serilog:write-to:MSSqlServer.connectionString" value="Data Source=.;Initial Catalog=IdentifyLog;User ID=sa;Password=Test!234;"/>
    <add key="serilog:write-to:MSSqlServer.tableName" value="Logs"/>
    <add key="serilog:write-to:MSSqlServer.autoCreateSqlTable" value="true"/>

  • Copy Serilog.Sinks.MSSqlServer.dll and Serilog.Sinks.PeriodicBatching.dll assemblies to admin/bin, runtime/bin folder. Link download: here
  • Restart IIS