NLog.Database includes DatabaseTarget for writing to any database with DbProvider support
$ dotnet add package NLog.DatabaseNLog Database Target can write to any database that has ADO.NET Database Provider. Ex. NS-SQL, MySQL, SqLite, Oracle, etc.
Make sure to also install the nuget-package for the wanted Database Provider, and configure the DbProvider for the Database Target.
See the NLog Wiki for available options and examples.
NLog will only recognize type-alias database when loading from NLog.config-file, if having added extension to NLog.config-file:
<extensions>
<add assembly="NLog.Database"/>
</extensions>
Alternative register from code using fluent configuration API:
LogManager.Setup().SetupExtensions(ext => ext.RegisterTarget<NLog.Targets.DatabaseTarget>());