创建 NLog 文件校验和
Create NLog file checksum
我们正在使用 NLog,需要对日志进行完整性检查。以确保它没有被篡改。
我们希望在日志文件滚动后为其创建 SHA-256 哈希,并将其存储在数据库中以供检查。
有谁知道 NLog 是否已提供此功能?
如果不是,实施这个的起点是什么?
滚动文件时是否有我们可以订阅的事件?
谢谢。
Does anyone know if this is already available by NLog?
它不在 NLog 本身。
Is there event that we can subscribe that get's called when file is rolled?
目前没有。这些事件有一个 feature request。
If not what would be the starting point to implement this?
您可以创建自己的目标(封装 FileTarget)或包装器目标。 Examples of wrapper targets are in GitHub
我们正在使用 NLog,需要对日志进行完整性检查。以确保它没有被篡改。
我们希望在日志文件滚动后为其创建 SHA-256 哈希,并将其存储在数据库中以供检查。
有谁知道 NLog 是否已提供此功能? 如果不是,实施这个的起点是什么? 滚动文件时是否有我们可以订阅的事件?
谢谢。
Does anyone know if this is already available by NLog?
它不在 NLog 本身。
Is there event that we can subscribe that get's called when file is rolled?
目前没有。这些事件有一个 feature request。
If not what would be the starting point to implement this?
您可以创建自己的目标(封装 FileTarget)或包装器目标。 Examples of wrapper targets are in GitHub