LogInventory

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.
  1. At Root path:, enter the directory containing the C# source code you want to scan.
  2. At Save path:, enter the destination CSV file path, such as log-inventory.csv.
  3. If the destination file already exists, enter y to overwrite it or n to cancel.

Source code: https://github.com/Anders-H/LogInventory

Bjud mig på en kopp kaffe (20:-) som tack för bra innehåll:

Bjud mig på en kopp kaffe (20:-) som tack för bra innehåll!

Comments

Important information: If you have not commented before, your comment will be reviewed before it is published. This means that you will not see it immediately, but I have received it. This is not because I want to filter comments, but because I want to prevent spam and advertising.

Leave a Reply

Your email address will not be published. Required fields are marked *