DotnetLog.Cli
0.1.0
See the version list below for details.
dotnet tool install --global DotnetLog.Cli --version 0.1.0
dotnet new tool-manifest
dotnet tool install --local DotnetLog.Cli --version 0.1.0
#tool dotnet:?package=DotnetLog.Cli&version=0.1.0
nuke :add-package DotnetLog.Cli --version 0.1.0
dotnet-log
Adds call logging to an application that is already built. No source code, no rebuild:
the tool opens the .dll files lying next to the application, writes a call to the logger
into the beginning and the end of every method, and puts the logger next to them.
Run it without installing anything (.NET 10 and above):
dnx DotnetLog.Cli -- "MyCompany.*" --dir C:\app
Or install it as a global tool and call it by name:
dotnet tool install -g DotnetLog.Cli
dotnet-log "MyCompany.*" --dir C:\app
The first arguments are masks of assembly names — which files to open at all. Everything that does not match a mask is left untouched, so the framework and other people's packages stay out of the log unless you ask for them.
Then start the application as usual. Every call goes into a JSONL log: one line per event, with the arguments, the returned value, the duration, the thread and the id of the calling method, so the whole call chain can be rebuilt later.
{"ts":"2026-08-28T02:18:13.9170918Z","ev":"enter","type":"Humanizer.NumberToWordsExtension","sig":"String ToWords(Int32, CultureInfo)","args":{"number":42},"id":1,"pid":0,"root":1,"d":0,"th":6}
{"ts":"2026-08-28T02:18:13.9273952Z","ev":"exit","ms":10.3,"ret":"forty-two","id":1}
Useful keys — the full list is in dotnet-log --help:
| Key | What it does |
|---|---|
--dir <folder> |
where the application lies (default: the current folder) |
--include-only <masks> |
narrow the selection down to certain types |
--dry-run |
show what would be changed and change nothing |
--restore |
put the original assemblies back |
-o <file> |
where to write the log |
Every original file is copied into .dotnet-log-backup before it is touched, so --restore
always has something to restore from.
Settings can be changed at start time, without processing the assemblies again, through
environment variables: DOTNET_LOG_PATH, DOTNET_LOG_FLUSH_MS, DOTNET_LOG_MAX_DEPTH
and so on. That is how the log is redirected when the application runs in a container.
The log itself is read by the companion package DotnetLog.Reader: it pairs the "enter + exit" lines, builds the call tree and draws it.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.