NLog.Database 6.0.0-preview1

NLog Database Target

NLog Database Target can write to any database that has ADO.NET Database Provider. Ex. MS-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.

If having trouble with output, then check NLog InternalLogger for clues. See also Troubleshooting NLog

See the NLog Wiki for available options and examples.

Register Extension

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>();
});

No packages depend on NLog.Database.

Docs: https://github.com/nlog/NLog/wiki/Database-target

.NET Framework 3.5

.NET Framework 4.5

.NET Framework 4.6

.NET Standard 2.0

Version Downloads Last updated
6.0.0-preview1 2 05/02/2025
5.4.0 9 02/13/2025
5.3.4 12 11/27/2024
5.3.3 10 12/07/2024
5.3.2 24 06/02/2024
5.3.1 17 04/27/2024
5.2.8 21 04/27/2024
5.2.7 17 05/22/2024
5.2.6 16 05/22/2024
5.2.5 7 01/06/2025
5.2.4 16 05/22/2024
5.2.3 12 12/02/2024
5.2.2 17 05/22/2024
5.2.1 17 07/04/2023
5.2.0 18 06/17/2023
5.1.5 17 06/17/2023
5.1.4 20 06/17/2023
5.1.3 65 04/13/2023
5.1.2 16 06/17/2023
5.1.1 11 11/29/2024
5.1.0 9 12/03/2024
5.0.5 13 05/22/2024
5.0.4 15 06/17/2023
5.0.3 11 12/02/2024
5.0.2 22 08/25/2022
5.0.1 18 07/25/2022
5.0.0 18 05/22/2024