Skip to content

SuperDaveLab/LogSmith

Repository files navigation

LogSmith

LogSmith is a fast, local log analyzer. The project is CLI-first (GUI planned later).

Supported log format (v0.1)

Currently supported:

  • Simple delimited lines like:
    • 2025-01-13 10:32:15,123 INFO OrderService - Created order 1234
  • Stack trace / continuation lines are attached to the previous entry when the line:
    • starts with whitespace, or
    • starts with at , or
    • starts with Caused by:

More parsers will be added over time.

Build

dotnet build

CLI usage

summarize (default)

dotnet run --project LogSmith.Cli -- summarize [--min-level LEVEL] [--top-errors N] fileOrPattern1 [fileOrPattern2 ...]

Examples:

dotnet run --project LogSmith.Cli -- summarize sample.log
dotnet run --project LogSmith.Cli -- summarize --min-level Warn --top-errors 5 "./logs/*.log"
dotnet run --project LogSmith.Cli -- summarize --since "2025-01-14T10:30:00Z" --until "2025-01-14T10:45:00Z" app.log

Example output (from samples/sample.log):

Summary
-------
Files analyzed : 1
Total lines    : 21
Parsed entries : 10
Unparsed lines : 0

Time range
---------
  Earliest: 2025-01-13T10:12:04.1230000+00:00
  Latest  : 2025-01-13T10:12:09.0000000+00:00

By level
--------
  Fatal: 0
  Error: 3
  Warn : 1
  Info : 5
  Debug: 1
  Trace: 0

Top 5 error patterns (normalized)
---------------------------------
  [2] "failed to load order <num>"
       e.g. 2025-01-13 10:12:07,200 ERROR TicketProcessor - Failed to load order 1234
  [1] "failed to acquire db connection <num> ms timeout"
       e.g. 2025-01-13 10:12:05,555 ERROR DbClient - Failed to acquire DB connection 30000 ms timeout

grep (v0.1)

dotnet run --project LogSmith.Cli -- grep [--level LEVEL] [--min-level LEVEL] [--contains TEXT] [--since <timestamp>] [--until <timestamp>] fileOrPattern

Example:

dotnet run --project LogSmith.Cli -- grep --level Error --contains timeout "./logs/app.log"
dotnet run --project LogSmith.Cli -- grep --since 1736860205123 --min-level Error app.log

Projects

  • LogSmith.Core: parsing + analysis primitives (clean, testable architecture)
  • LogSmith.Cli: command-line interface
  • LogSmith.Gui: placeholder project (GUI will be added later, likely with Avalonia)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages