LogInventory is a command-line tool for auditing what a C# codebase can write to its logs. It scans .cs files recursively for logging calls on ILogger and ILogger<T> and writes one row per detected call to a semicolon-delimited CSV file.
Build and run
LogInventory is written in C# and targets .NET 10. Install the .NET 10 SDK and compile the source code before running the tool. From the repository root, run these commands:
dotnet build LogInventory/LogInventory/LogInventory.csproj
dotnet run --project LogInventory/LogInventory/LogInventory.csproj --no-build
Usage
At Root path:, enter the directory containing the C# source code you want to scan.
- At
Root path:, enter the directory containing the C# source code you want to scan. - At
Save path:, enter the destination CSV file path, such aslog-inventory.csv. - If the destination file already exists, enter
yto overwrite it ornto cancel.
Source code: https://github.com/Anders-H/LogInventory

Leave a Reply