![]() |
VOOZH | about |
dotnet add package Audit.FileSystem --version 32.2.0
NuGet\Install-Package Audit.FileSystem -Version 32.2.0
<PackageReference Include="Audit.FileSystem" Version="32.2.0" />
<PackageVersion Include="Audit.FileSystem" Version="32.2.0" />Directory.Packages.props
<PackageReference Include="Audit.FileSystem" />Project file
paket add Audit.FileSystem --version 32.2.0
#r "nuget: Audit.FileSystem, 32.2.0"
#:package Audit.FileSystem@32.2.0
#addin nuget:?package=Audit.FileSystem&version=32.2.0Install as a Cake Addin
#tool nuget:?package=Audit.FileSystem&version=32.2.0Install as a Cake Tool
File System Extension for Audit.NET library.
Generate Audit Logs by intercepting file system events via FileSystemWatcher.
Audit.FileSystem provides the infrastructure to create audit logs from the file system events, like creating, renaming, modifying or deleting files and directories. It relies on FileSystemWatcher class to intercept the events, so the same limitations applies.
NuGet Package
To install the package run the following command on the Package Manager Console:
PM> Install-Package Audit.FileSystem
To enable the audit log for a directory, create an instance of FileSystemMonitor clas, and call its Start() method:
var fsMon = new Audit.FileSystem.FileSystemMonitor(@"c:\");
fsMon.Options.IncludeSubdirectories = true;
fsMon.Start();
Or by using the FileSystemMonitorOptions to provide the configuration:
var fsMon = new Audit.FileSystem.FileSystemMonitor(new FileSystemMonitorOptions()
{
Path = @"c:\",
IncludeSubdirectories = true,
Filter = "*.txt",
IncludeContentPredicate = fi => fi.Length <= 1024 ? FileSystem.ContentType.Text : FileSystem.ContentType.None,
CustomFilterPredicate = e => !e.FullPath.StartsWith("$RECYCLE.BIN")
});
The audit events are stored using a Data Provider. You can use one of the available data providers or implement your own. Please refer to the data providers section on Audit.NET documentation.
The FileSystemMonitorOptions class include the following settings:
Mandatory:
Optional:
Path should be monitored. Default is false.Filter string.ContentType indicating whether the contents
should be included as a string (Text), as a byte array (Binary) or not included (None).
By default content is not included.AuditScopeFactory is used.Audit.FileSystem output includes:
The following table describes the Audit.FileSystem output fields:
Describes an event from the file system.
| Field Name | Type | Description |
|---|---|---|
| Object | FileSystemObjectType | Indicates the object type: File, Directory or Unknown |
| Event | FileSystemEventType | The file system event type: Create, change, Rename or Delete |
| Errors | string | Any error encountered when processing the file/directory |
| Attributes | string | The file/directory attributes |
| Name | string | The file/directory name |
| OldName | string | In case of rename, the old file/directory name |
| Extension | string | The file extension including the point |
| FullPath | string | The full path to the file/directory |
| Length | long | The file length in bytes |
| CreationTime | datetime | The file/directory creation date and time |
| LastAccessTime | datetime | The file/directory last access date and time |
| LastWriteTime | datetime | The file/directory last write date and time |
| ReadOnly | boolean | Value indicating if the file is read only |
| MD5 | boolean | The MD5 hash of the file |
| FileContent | FileContent | The file contents when included |
Represents the contents of an audited file.
| Field Name | Type | Description |
|---|---|---|
| Type | ContentType | The content type: Text or Binary |
| Value | string/byte array | The string (text) or byte array (binary) with the file contents |
File creation:
{
"EventType": "[Created] file.txt",
"Environment": {
"UserName": "Federico",
"MachineName": "HP",
"DomainName": "HP",
"Culture": "en-US"
},
"StartDate": "2017-11-26T23:01:44.5567169-06:00",
"EndDate": "2017-11-26T23:01:44.5567169-06:00",
"Duration": 0,
"FileSystemEvent": {
"Object": "File",
"Event": "Create",
"Attributes": "Archive",
"Name": "file.txt",
"Extension": ".txt",
"FullPath": "c:\\Users\\Federico\\Documents\\file.txt",
"Length": 694,
"CreationTime": "2017-11-26T23:01:11.750589-06:00",
"LastAccessTime": "2017-11-26T23:01:11.750589-06:00",
"LastWriteTime": "2017-11-26T23:01:11.7515849-06:00",
"MD5": "ddc032e5fe9bb3aa15144cdc35d959c5"
}
}
File renaming
{
"EventType": "[Renamed] renamed.txt",
"Environment": {
"UserName": "Federico",
"MachineName": "HP",
"DomainName": "HP",
"Culture": "en-US"
},
"StartDate": "2017-11-26T23:01:37.8409103-06:00",
"EndDate": "2017-11-26T23:01:37.8409103-06:00",
"Duration": 0,
"FileSystemEvent": {
"Object": "File",
"Event": "Rename",
"OldName": "file.txt",
"Name": "renamed.txt",
"Extension": ".txt",
"FullPath": "c:\\Users\\Federico\\Documents\\renamed.txt"
}
}
IO Exception:
{
"EventType": "[Created] tmpFC2D.tmp",
"Environment": {
"UserName": "Federico",
"MachineName": "HP",
"DomainName": "HP",
"Culture": "en-US"
},
"StartDate": "2017-11-26T23:01:03.7363727-06:00",
"EndDate": "2017-11-26T23:01:03.7363727-06:00",
"Duration": 0,
"FileSystemEvent": {
"Object": "File",
"Event": "Create",
"Errors": [
"IOException when getting file attributes: Could not find file 'c:\\Users\\Federico\\AppData\\Local\\Temp\\tmpFC2D.tmp'."
],
"Name": "tmpFC2D.tmp",
"Extension": ".tmp",
"FullPath": "c:\\Users\\Federico\\AppData\\Local\\Temp\\tmpFC2D.tmp"
}
}
Entity Framework Extensions and Dapper Plus are major sponsors and are proud to contribute to the development of Audit.NET
Combine the power of auditing with the speed of Bulk Operations to get the best of both worlds — audit and performance.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 1 NuGet packages that depend on Audit.FileSystem:
| Package | Downloads |
|---|---|
|
RezisFramework
Package Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 32.2.0 | 91 | 6/12/2026 |
| 32.1.1 | 107 | 6/1/2026 |
| 32.1.0 | 263 | 5/7/2026 |
| 32.0.0 | 366 | 1/8/2026 |
| 31.3.3 | 152 | 12/31/2025 |
| 31.3.2 | 168 | 12/20/2025 |
| 31.3.1 | 996 | 12/9/2025 |
| 31.3.0 | 277 | 12/5/2025 |
| 31.2.0 | 257 | 11/27/2025 |
| 31.1.0 | 241 | 11/26/2025 |
| 31.0.2 | 294 | 10/2/2025 |
| 31.0.1 | 305 | 8/28/2025 |
| 31.0.0 | 220 | 8/22/2025 |
| 30.1.3 | 260 | 8/19/2025 |
| 30.1.2 | 249 | 8/14/2025 |
| 30.1.1 | 251 | 8/13/2025 |
| 30.0.2 | 333 | 6/26/2025 |
| 30.0.1 | 274 | 5/29/2025 |
| 30.0.0 | 288 | 5/27/2025 |
| 29.0.1 | 281 | 5/8/2025 |