How to setting up Serilog Sink in Identify
You can use the Serilog Sink log store to let Identify to log to any log store that Serilog supports via its sinks.
How to set up Serilog Sink for MSSqlSever
To use the MSSqlServer log store, you can do the following steps:
- Change the Log target setting found in Logging/Settings to SerilogSinks:
- Create a new database in your SQL Server. In this example, I created database named 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 your instance's Admin/bin and Runtime/bin folders. You can download the assemblies here.
- Restart your Identify instance website under IIS.