logler 1.1.3__tar.gz → 1.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. {logler-1.1.3 → logler-1.2.0}/Cargo.lock +28 -29
  2. {logler-1.1.3 → logler-1.2.0}/Cargo.toml +1 -1
  3. {logler-1.1.3 → logler-1.2.0}/PKG-INFO +48 -44
  4. {logler-1.1.3 → logler-1.2.0}/README.md +47 -43
  5. {logler-1.1.3 → logler-1.2.0}/crates/logler-core/src/hierarchy.rs +46 -20
  6. {logler-1.1.3 → logler-1.2.0}/crates/logler-core/src/index.rs +10 -0
  7. logler-1.2.0/crates/logler-core/src/investigate.rs +977 -0
  8. {logler-1.1.3 → logler-1.2.0}/crates/logler-core/src/lib.rs +2 -0
  9. {logler-1.1.3 → logler-1.2.0}/crates/logler-core/src/parser.rs +178 -0
  10. {logler-1.1.3 → logler-1.2.0}/crates/logler-core/src/types.rs +37 -2
  11. {logler-1.1.3 → logler-1.2.0}/crates/logler-py/src/lib.rs +48 -0
  12. {logler-1.1.3 → logler-1.2.0}/pyproject.toml +3 -1
  13. {logler-1.1.3 → logler-1.2.0}/src/logler/cli.py +18 -85
  14. {logler-1.1.3 → logler-1.2.0}/src/logler/helpers.py +0 -85
  15. {logler-1.1.3 → logler-1.2.0}/src/logler/investigate.py +238 -473
  16. {logler-1.1.3 → logler-1.2.0}/src/logler/llm_cli.py +642 -126
  17. logler-1.1.3/crates/logler-core/src/investigate.rs +0 -516
  18. {logler-1.1.3 → logler-1.2.0}/LICENSE +0 -0
  19. {logler-1.1.3 → logler-1.2.0}/crates/logler-core/Cargo.toml +0 -0
  20. {logler-1.1.3 → logler-1.2.0}/crates/logler-core/src/filter.rs +0 -0
  21. {logler-1.1.3 → logler-1.2.0}/crates/logler-core/src/reader.rs +0 -0
  22. {logler-1.1.3 → logler-1.2.0}/crates/logler-core/src/stats.rs +0 -0
  23. {logler-1.1.3 → logler-1.2.0}/crates/logler-core/src/thread_tracker.rs +0 -0
  24. {logler-1.1.3 → logler-1.2.0}/crates/logler-core/src/trace.rs +0 -0
  25. {logler-1.1.3 → logler-1.2.0}/crates/logler-py/Cargo.toml +0 -0
  26. {logler-1.1.3 → logler-1.2.0}/src/logler/__init__.py +0 -0
  27. {logler-1.1.3 → logler-1.2.0}/src/logler/bootstrap.py +0 -0
  28. {logler-1.1.3 → logler-1.2.0}/src/logler/cache.py +0 -0
  29. {logler-1.1.3 → logler-1.2.0}/src/logler/log_reader.py +0 -0
  30. {logler-1.1.3 → logler-1.2.0}/src/logler/models.py +0 -0
  31. {logler-1.1.3 → logler-1.2.0}/src/logler/parser.py +0 -0
  32. {logler-1.1.3 → logler-1.2.0}/src/logler/safe_regex.py +0 -0
  33. {logler-1.1.3 → logler-1.2.0}/src/logler/sql.py +0 -0
  34. {logler-1.1.3 → logler-1.2.0}/src/logler/terminal.py +0 -0
  35. {logler-1.1.3 → logler-1.2.0}/src/logler/tracker.py +0 -0
  36. {logler-1.1.3 → logler-1.2.0}/src/logler/tree_formatter.py +0 -0
  37. {logler-1.1.3 → logler-1.2.0}/src/logler/watcher.py +0 -0
@@ -253,9 +253,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
253
253
 
254
254
  [[package]]
255
255
  name = "cc"
256
- version = "1.2.54"
256
+ version = "1.2.55"
257
257
  source = "registry+https://github.com/rust-lang/crates.io-index"
258
- checksum = "6354c81bbfd62d9cfa9cb3c773c2b7b2a3a482d569de977fd0e961f6e7c00583"
258
+ checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29"
259
259
  dependencies = [
260
260
  "find-msvc-tools",
261
261
  "shlex",
@@ -310,9 +310,9 @@ dependencies = [
310
310
 
311
311
  [[package]]
312
312
  name = "clap"
313
- version = "4.5.54"
313
+ version = "4.5.56"
314
314
  source = "registry+https://github.com/rust-lang/crates.io-index"
315
- checksum = "c6e6ff9dcd79cff5cd969a17a545d79e84ab086e444102a591e288a8aa3ce394"
315
+ checksum = "a75ca66430e33a14957acc24c5077b503e7d374151b2b4b3a10c83b4ceb4be0e"
316
316
  dependencies = [
317
317
  "clap_builder",
318
318
  "clap_derive",
@@ -320,9 +320,9 @@ dependencies = [
320
320
 
321
321
  [[package]]
322
322
  name = "clap_builder"
323
- version = "4.5.54"
323
+ version = "4.5.56"
324
324
  source = "registry+https://github.com/rust-lang/crates.io-index"
325
- checksum = "fa42cf4d2b7a41bc8f663a7cab4031ebafa1bf3875705bfaf8466dc60ab52c00"
325
+ checksum = "793207c7fa6300a0608d1080b858e5fdbe713cdc1c8db9fb17777d8a13e63df0"
326
326
  dependencies = [
327
327
  "anstream",
328
328
  "anstyle",
@@ -332,9 +332,9 @@ dependencies = [
332
332
 
333
333
  [[package]]
334
334
  name = "clap_derive"
335
- version = "4.5.49"
335
+ version = "4.5.55"
336
336
  source = "registry+https://github.com/rust-lang/crates.io-index"
337
- checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671"
337
+ checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5"
338
338
  dependencies = [
339
339
  "heck 0.5.0",
340
340
  "proc-macro2",
@@ -531,9 +531,9 @@ dependencies = [
531
531
 
532
532
  [[package]]
533
533
  name = "find-msvc-tools"
534
- version = "0.1.8"
534
+ version = "0.1.9"
535
535
  source = "registry+https://github.com/rust-lang/crates.io-index"
536
- checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db"
536
+ checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
537
537
 
538
538
  [[package]]
539
539
  name = "form_urlencoded"
@@ -778,12 +778,11 @@ dependencies = [
778
778
 
779
779
  [[package]]
780
780
  name = "hyper-util"
781
- version = "0.1.19"
781
+ version = "0.1.20"
782
782
  source = "registry+https://github.com/rust-lang/crates.io-index"
783
- checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f"
783
+ checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0"
784
784
  dependencies = [
785
785
  "bytes",
786
- "futures-core",
787
786
  "http",
788
787
  "http-body",
789
788
  "hyper",
@@ -794,9 +793,9 @@ dependencies = [
794
793
 
795
794
  [[package]]
796
795
  name = "iana-time-zone"
797
- version = "0.1.64"
796
+ version = "0.1.65"
798
797
  source = "registry+https://github.com/rust-lang/crates.io-index"
799
- checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb"
798
+ checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470"
800
799
  dependencies = [
801
800
  "android_system_properties",
802
801
  "core-foundation-sys",
@@ -953,7 +952,7 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
953
952
 
954
953
  [[package]]
955
954
  name = "logler-cli"
956
- version = "1.1.3"
955
+ version = "1.2.0"
957
956
  dependencies = [
958
957
  "anyhow",
959
958
  "clap",
@@ -968,7 +967,7 @@ dependencies = [
968
967
 
969
968
  [[package]]
970
969
  name = "logler-core"
971
- version = "1.1.3"
970
+ version = "1.2.0"
972
971
  dependencies = [
973
972
  "anyhow",
974
973
  "async-stream",
@@ -992,7 +991,7 @@ dependencies = [
992
991
 
993
992
  [[package]]
994
993
  name = "logler-py"
995
- version = "1.1.3"
994
+ version = "1.2.0"
996
995
  dependencies = [
997
996
  "anyhow",
998
997
  "logler-core",
@@ -1004,7 +1003,7 @@ dependencies = [
1004
1003
 
1005
1004
  [[package]]
1006
1005
  name = "logler-server"
1007
- version = "1.1.3"
1006
+ version = "1.2.0"
1008
1007
  dependencies = [
1009
1008
  "anyhow",
1010
1009
  "axum",
@@ -1217,9 +1216,9 @@ dependencies = [
1217
1216
 
1218
1217
  [[package]]
1219
1218
  name = "portable-atomic"
1220
- version = "1.13.0"
1219
+ version = "1.13.1"
1221
1220
  source = "registry+https://github.com/rust-lang/crates.io-index"
1222
- checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950"
1221
+ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
1223
1222
 
1224
1223
  [[package]]
1225
1224
  name = "ppv-lite86"
@@ -1560,9 +1559,9 @@ dependencies = [
1560
1559
 
1561
1560
  [[package]]
1562
1561
  name = "slab"
1563
- version = "0.4.11"
1562
+ version = "0.4.12"
1564
1563
  source = "registry+https://github.com/rust-lang/crates.io-index"
1565
- checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
1564
+ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
1566
1565
 
1567
1566
  [[package]]
1568
1567
  name = "smallvec"
@@ -2215,18 +2214,18 @@ checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
2215
2214
 
2216
2215
  [[package]]
2217
2216
  name = "zerocopy"
2218
- version = "0.8.33"
2217
+ version = "0.8.37"
2219
2218
  source = "registry+https://github.com/rust-lang/crates.io-index"
2220
- checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd"
2219
+ checksum = "7456cf00f0685ad319c5b1693f291a650eaf345e941d082fc4e03df8a03996ac"
2221
2220
  dependencies = [
2222
2221
  "zerocopy-derive",
2223
2222
  ]
2224
2223
 
2225
2224
  [[package]]
2226
2225
  name = "zerocopy-derive"
2227
- version = "0.8.33"
2226
+ version = "0.8.37"
2228
2227
  source = "registry+https://github.com/rust-lang/crates.io-index"
2229
- checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1"
2228
+ checksum = "1328722bbf2115db7e19d69ebcc15e795719e2d66b60827c6a69a117365e37a0"
2230
2229
  dependencies = [
2231
2230
  "proc-macro2",
2232
2231
  "quote",
@@ -2235,6 +2234,6 @@ dependencies = [
2235
2234
 
2236
2235
  [[package]]
2237
2236
  name = "zmij"
2238
- version = "1.0.16"
2237
+ version = "1.0.19"
2239
2238
  source = "registry+https://github.com/rust-lang/crates.io-index"
2240
- checksum = "dfcd145825aace48cff44a8844de64bf75feec3080e0aa5cdbde72961ae51a65"
2239
+ checksum = "3ff05f8caa9038894637571ae6b9e29466c1f4f829d26c9b28f869a29cbe3445"
@@ -3,7 +3,7 @@ members = ["crates/logler-py"]
3
3
  resolver = "2"
4
4
 
5
5
  [workspace.package]
6
- version = "1.1.3"
6
+ version = "1.2.0"
7
7
  edition = "2021"
8
8
  authors = ["Logler Contributors"]
9
9
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: logler
3
- Version: 1.1.3
3
+ Version: 1.2.0
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -73,36 +73,25 @@ A modern, feature-rich log viewer that makes debugging a pleasure. View logs in
73
73
  - 🔍 **Semantic Search** - Find errors by description, not just exact matches
74
74
  - 🧵 **Thread Following** - Reconstruct request flows across distributed systems
75
75
  - 🌳 **Hierarchy Visualization** - Tree and waterfall views of nested operations, bottleneck detection
76
- - 📊 **Pattern Detection** - Automatically find repeated errors and cascading failures
77
76
  - 💾 **SQL Queries** - DuckDB-powered custom analysis for deep investigation
78
77
  - 📈 **Statistical Analysis** - Z-scores, percentiles, correlations, anomaly detection
78
+ - 🌐 **OpenTelemetry Export** - Export traces to Jaeger, Zipkin, or OTLP collectors
79
79
  - 🌍 **Bilingual Docs** - Complete documentation in English and Japanese (日本語)
80
80
 
81
81
  ### 🚀 NEW: Advanced LLM Features
82
82
 
83
83
  **Designed specifically for AI agents with limited context windows:**
84
84
 
85
- - 💡 **Auto Insights** - `analyze_with_insights()` automatically detects patterns, errors, and suggests next steps
86
85
  - 📉 **Token-Efficient Output** - 44x token savings with summary/count/compact modes
87
86
  - 🔀 **Compare & Diff** - Compare successful vs failed requests, before/after deployments
88
87
  - 🌐 **Cross-Service Timeline** - Unified view across microservices for distributed debugging
89
88
  - 📝 **Investigation Sessions** - Track progress, undo/redo, save/resume investigations
90
89
  - 🎯 **Smart Sampling** - Representative sampling with multiple strategies (diverse, errors-focused, chronological)
91
90
  - 📄 **Report Generation** - Auto-generate markdown/text/JSON reports from investigation
92
- - 🤔 **Explain Feature** - Plain English explanations of cryptic errors with next steps
93
- - 💬 **Contextual Suggestions** - AI suggests what to investigate next based on findings
94
91
 
95
92
  ### Public API Contract
96
93
 
97
- Each code block carries a **Contract ID** (e.g., `[C01]`). The test suite in `tests/test_readme.py` executes these snippets against the documented public APIs. When this section changes, the tests must change with it — CI proves the README.
98
-
99
- #### [C01] Auto-insights analysis
100
- ```python
101
- import logler.investigate as investigate
102
-
103
- result = investigate.analyze_with_insights(files=["app.log"])
104
- print(result['insights']) # Automatic pattern detection, error analysis, suggestions
105
- ```
94
+ Each code block carries a **Contract ID** (e.g., `[C02]`). The test suite in `tests/test_readme.py` executes these snippets against the documented public APIs. When this section changes, the tests must change with it — CI proves the README.
106
95
 
107
96
  #### [C02] Token-efficient search
108
97
  ```python
@@ -141,7 +130,6 @@ import logler.investigate as investigate
141
130
 
142
131
  session = investigate.InvestigationSession(files=["app.log"], name="incident_2024")
143
132
  session.search(level="ERROR")
144
- session.find_patterns()
145
133
  session.add_note("Database connection pool exhausted")
146
134
  report = session.generate_report(format="markdown") # Auto-generate report
147
135
  ```
@@ -157,14 +145,6 @@ sample = investigate.smart_sample(
157
145
  )
158
146
  ```
159
147
 
160
- #### [C07] Error explanation
161
- ```python
162
- import logler.investigate as investigate
163
-
164
- explanation = investigate.explain(error_message="Connection pool exhausted", context="production")
165
- print(explanation) # Common causes, next steps, production-specific advice
166
- ```
167
-
168
148
  #### [C08] Thread hierarchy
169
149
  ```python
170
150
  import logler.investigate as investigate
@@ -198,7 +178,7 @@ print_waterfall(hierarchy, width=100) # Waterfall timeline
198
178
  ```
199
179
 
200
180
  **📚 Complete LLM documentation:**
201
- - [LLM CLI Reference](docs/LLM_CLI_REFERENCE.md) - All 16 CLI commands for AI agents
181
+ - [LLM CLI Reference](docs/LLM_CLI_REFERENCE.md) - All 17 CLI commands for AI agents
202
182
  - [Python API Guide](docs/LLM_README.md) - Library API and examples
203
183
  - [API Reference](docs/LLM_INVESTIGATION_API.md) - All investigation functions
204
184
  - [日本語ガイド](README.ja.md) - 完全なドキュメント
@@ -236,9 +216,7 @@ logler stats app.log --json # JSON output
236
216
 
237
217
  **Investigate logs with smart analysis:**
238
218
  ```bash
239
- logler investigate app.log --auto-insights # Auto-detect issues
240
219
  logler investigate app.log --errors # Analyze errors
241
- logler investigate app.log --patterns # Find repeated patterns
242
220
  logler investigate app.log --thread worker-1 # Follow specific thread
243
221
  logler investigate app.log --correlation req-123 # Follow correlation ID
244
222
  logler investigate app.log --trace trace-abc123 # Follow distributed trace
@@ -254,7 +232,7 @@ logler investigate app.log --thread worker-1 --hierarchy --max-depth 3 # Limit
254
232
 
255
233
  **LLM-first CLI (JSON output by default):**
256
234
 
257
- Designed for AI agents - 16 commands with structured JSON output, no truncation.
235
+ Designed for AI agents - 17 commands with structured JSON output, no truncation.
258
236
 
259
237
  ```bash
260
238
  # Assessment & Overview
@@ -262,8 +240,13 @@ logler llm triage app.log --last 1h # Quick severity assessment
262
240
  logler llm summarize app.log # Concise summary with stats
263
241
  logler llm schema app.log # Infer log structure
264
242
 
265
- # Search & Analysis
266
- logler llm search app.log --level ERROR # Find entries (full results)
243
+ # Discovery
244
+ logler llm ids app.log # Find all thread/correlation/trace IDs
245
+
246
+ # Search & Analysis (with filtering)
247
+ logler llm search app.log --level ERROR,WARN --tail 20 # Last 20 errors/warnings
248
+ logler llm search app.log --exclude-level DEBUG --service api # Filter by service
249
+ logler llm search app.log --exclude-query "health" --max-bytes 4000 # Budget-controlled
267
250
  logler llm sql "SELECT level, COUNT(*) FROM logs GROUP BY level" -f app.log
268
251
 
269
252
  # Request Tracing
@@ -281,7 +264,7 @@ logler llm context app.log 1523 --before 10 --after 10
281
264
  logler llm export trace-xyz --format jaeger
282
265
  ```
283
266
 
284
- See **[LLM CLI Reference](docs/LLM_CLI_REFERENCE.md)** for complete documentation of all 16 commands.
267
+ See **[LLM CLI Reference](docs/LLM_CLI_REFERENCE.md)** for complete documentation of all 17 commands.
285
268
 
286
269
  ### Visualization Modes
287
270
 
@@ -385,25 +368,20 @@ logler stats app.log --json | jq '.by_level'
385
368
  ### Investigation & Analysis
386
369
 
387
370
  ```bash
388
- # Auto-detect issues with insights
389
- logler investigate app.log --auto-insights
390
- # Output: Automatic error analysis, pattern detection, actionable suggestions
391
-
392
371
  # Analyze errors with context
393
372
  logler investigate app.log --errors
394
373
  # Shows error frequency, top error messages, time ranges
395
374
 
396
- # Find repeated patterns
397
- logler investigate app.log --patterns --min-occurrences 5
398
- # Identifies logs that repeat 5+ times
399
-
400
375
  # Follow a specific thread or request
401
376
  logler investigate app.log --thread worker-1
402
377
  logler investigate app.log --correlation req-abc123
403
378
  logler investigate app.log --trace trace-xyz789
404
379
 
380
+ # Build hierarchy tree with bottleneck detection
381
+ logler investigate app.log --correlation req-123 --hierarchy
382
+
405
383
  # Token-efficient output for LLMs
406
- logler investigate app.log --auto-insights --output summary
384
+ logler investigate app.log --errors --output summary
407
385
  # Returns aggregated statistics instead of full logs
408
386
 
409
387
  # JSON output for automation
@@ -465,7 +443,7 @@ To unlock **all** of logler's capabilities (especially multi-level thread hierar
465
443
  |-------|---------|---------|
466
444
  | `timestamp` | When the event occurred (ISO 8601) | Timeline, duration analysis |
467
445
  | `level` | Log level (DEBUG/INFO/WARN/ERROR/FATAL) | Filtering, error detection |
468
- | `message` | Human-readable description | Search, pattern detection |
446
+ | `message` | Human-readable description | Search, filtering |
469
447
  | `thread_id` | Thread/worker identifier | Thread grouping, timeline |
470
448
  | `correlation_id` | Request ID across services | Cross-service tracing |
471
449
  | `trace_id` | Distributed trace identifier | OpenTelemetry integration |
@@ -577,10 +555,36 @@ Built with:
577
555
 
578
556
  1. **Use `--follow` mode** for real-time debugging
579
557
  2. **Filter by thread** to trace execution flow
580
- 3. **Use `--auto-insights`** for automatic issue detection
558
+ 3. **Use `--hierarchy`** to visualize request flow with bottleneck detection
581
559
  4. **Export stats as JSON** for automation
582
560
  5. **Watch directories** for new log files
583
561
 
562
+ ## 🎓 Interactive Tours
563
+
564
+ Learn logler hands-on with [marimo](https://marimo.io/) notebook tours. Each tour is self-contained with sample data -- no external files needed.
565
+
566
+ ```bash
567
+ # Run any tour in your browser
568
+ uv run marimo edit examples/tours/tour_01_fundamentals.py
569
+ ```
570
+
571
+ | Tour | Topic |
572
+ |------|-------|
573
+ | 01 | Fundamentals -- search, filter, output formats |
574
+ | 02 | Thread Tracking -- grouping, correlation IDs |
575
+ | 03 | Hierarchy -- tree views, waterfall, bottleneck detection |
576
+ | 04 | Investigation -- sessions, history, report generation |
577
+ | 06 | Flamegraph -- performance visualization |
578
+ | 07 | Error Flow -- root cause analysis, propagation chains |
579
+ | 08 | Comparison -- diff hierarchies, compare threads |
580
+ | 09 | Tracing Exports -- Jaeger and Zipkin formats |
581
+ | 10 | Sampling -- smart sampling strategies |
582
+ | 12 | Multi-File -- cross-service distributed tracing |
583
+ | 13 | Live Watching -- real-time tailing and streaming |
584
+ | 14 | Performance -- 10K+ entries, benchmarks |
585
+
586
+ See the [examples README](examples/README.md) for the full learning path.
587
+
584
588
  ## 🎓 Examples
585
589
 
586
590
  ### Debug a specific request
@@ -602,10 +606,10 @@ logler view app.log -f --level ERROR
602
606
  logler view app.log --thread worker-1
603
607
  ```
604
608
 
605
- ### Investigate with insights
609
+ ### Build request hierarchy
606
610
  ```bash
607
- logler investigate app.log --auto-insights
608
- # Automatic pattern detection and issue analysis
611
+ logler investigate app.log --correlation req-123 --hierarchy
612
+ # Visualize request flow with bottleneck detection
609
613
  ```
610
614
 
611
615
  ---
@@ -35,36 +35,25 @@ A modern, feature-rich log viewer that makes debugging a pleasure. View logs in
35
35
  - 🔍 **Semantic Search** - Find errors by description, not just exact matches
36
36
  - 🧵 **Thread Following** - Reconstruct request flows across distributed systems
37
37
  - 🌳 **Hierarchy Visualization** - Tree and waterfall views of nested operations, bottleneck detection
38
- - 📊 **Pattern Detection** - Automatically find repeated errors and cascading failures
39
38
  - 💾 **SQL Queries** - DuckDB-powered custom analysis for deep investigation
40
39
  - 📈 **Statistical Analysis** - Z-scores, percentiles, correlations, anomaly detection
40
+ - 🌐 **OpenTelemetry Export** - Export traces to Jaeger, Zipkin, or OTLP collectors
41
41
  - 🌍 **Bilingual Docs** - Complete documentation in English and Japanese (日本語)
42
42
 
43
43
  ### 🚀 NEW: Advanced LLM Features
44
44
 
45
45
  **Designed specifically for AI agents with limited context windows:**
46
46
 
47
- - 💡 **Auto Insights** - `analyze_with_insights()` automatically detects patterns, errors, and suggests next steps
48
47
  - 📉 **Token-Efficient Output** - 44x token savings with summary/count/compact modes
49
48
  - 🔀 **Compare & Diff** - Compare successful vs failed requests, before/after deployments
50
49
  - 🌐 **Cross-Service Timeline** - Unified view across microservices for distributed debugging
51
50
  - 📝 **Investigation Sessions** - Track progress, undo/redo, save/resume investigations
52
51
  - 🎯 **Smart Sampling** - Representative sampling with multiple strategies (diverse, errors-focused, chronological)
53
52
  - 📄 **Report Generation** - Auto-generate markdown/text/JSON reports from investigation
54
- - 🤔 **Explain Feature** - Plain English explanations of cryptic errors with next steps
55
- - 💬 **Contextual Suggestions** - AI suggests what to investigate next based on findings
56
53
 
57
54
  ### Public API Contract
58
55
 
59
- Each code block carries a **Contract ID** (e.g., `[C01]`). The test suite in `tests/test_readme.py` executes these snippets against the documented public APIs. When this section changes, the tests must change with it — CI proves the README.
60
-
61
- #### [C01] Auto-insights analysis
62
- ```python
63
- import logler.investigate as investigate
64
-
65
- result = investigate.analyze_with_insights(files=["app.log"])
66
- print(result['insights']) # Automatic pattern detection, error analysis, suggestions
67
- ```
56
+ Each code block carries a **Contract ID** (e.g., `[C02]`). The test suite in `tests/test_readme.py` executes these snippets against the documented public APIs. When this section changes, the tests must change with it — CI proves the README.
68
57
 
69
58
  #### [C02] Token-efficient search
70
59
  ```python
@@ -103,7 +92,6 @@ import logler.investigate as investigate
103
92
 
104
93
  session = investigate.InvestigationSession(files=["app.log"], name="incident_2024")
105
94
  session.search(level="ERROR")
106
- session.find_patterns()
107
95
  session.add_note("Database connection pool exhausted")
108
96
  report = session.generate_report(format="markdown") # Auto-generate report
109
97
  ```
@@ -119,14 +107,6 @@ sample = investigate.smart_sample(
119
107
  )
120
108
  ```
121
109
 
122
- #### [C07] Error explanation
123
- ```python
124
- import logler.investigate as investigate
125
-
126
- explanation = investigate.explain(error_message="Connection pool exhausted", context="production")
127
- print(explanation) # Common causes, next steps, production-specific advice
128
- ```
129
-
130
110
  #### [C08] Thread hierarchy
131
111
  ```python
132
112
  import logler.investigate as investigate
@@ -160,7 +140,7 @@ print_waterfall(hierarchy, width=100) # Waterfall timeline
160
140
  ```
161
141
 
162
142
  **📚 Complete LLM documentation:**
163
- - [LLM CLI Reference](docs/LLM_CLI_REFERENCE.md) - All 16 CLI commands for AI agents
143
+ - [LLM CLI Reference](docs/LLM_CLI_REFERENCE.md) - All 17 CLI commands for AI agents
164
144
  - [Python API Guide](docs/LLM_README.md) - Library API and examples
165
145
  - [API Reference](docs/LLM_INVESTIGATION_API.md) - All investigation functions
166
146
  - [日本語ガイド](README.ja.md) - 完全なドキュメント
@@ -198,9 +178,7 @@ logler stats app.log --json # JSON output
198
178
 
199
179
  **Investigate logs with smart analysis:**
200
180
  ```bash
201
- logler investigate app.log --auto-insights # Auto-detect issues
202
181
  logler investigate app.log --errors # Analyze errors
203
- logler investigate app.log --patterns # Find repeated patterns
204
182
  logler investigate app.log --thread worker-1 # Follow specific thread
205
183
  logler investigate app.log --correlation req-123 # Follow correlation ID
206
184
  logler investigate app.log --trace trace-abc123 # Follow distributed trace
@@ -216,7 +194,7 @@ logler investigate app.log --thread worker-1 --hierarchy --max-depth 3 # Limit
216
194
 
217
195
  **LLM-first CLI (JSON output by default):**
218
196
 
219
- Designed for AI agents - 16 commands with structured JSON output, no truncation.
197
+ Designed for AI agents - 17 commands with structured JSON output, no truncation.
220
198
 
221
199
  ```bash
222
200
  # Assessment & Overview
@@ -224,8 +202,13 @@ logler llm triage app.log --last 1h # Quick severity assessment
224
202
  logler llm summarize app.log # Concise summary with stats
225
203
  logler llm schema app.log # Infer log structure
226
204
 
227
- # Search & Analysis
228
- logler llm search app.log --level ERROR # Find entries (full results)
205
+ # Discovery
206
+ logler llm ids app.log # Find all thread/correlation/trace IDs
207
+
208
+ # Search & Analysis (with filtering)
209
+ logler llm search app.log --level ERROR,WARN --tail 20 # Last 20 errors/warnings
210
+ logler llm search app.log --exclude-level DEBUG --service api # Filter by service
211
+ logler llm search app.log --exclude-query "health" --max-bytes 4000 # Budget-controlled
229
212
  logler llm sql "SELECT level, COUNT(*) FROM logs GROUP BY level" -f app.log
230
213
 
231
214
  # Request Tracing
@@ -243,7 +226,7 @@ logler llm context app.log 1523 --before 10 --after 10
243
226
  logler llm export trace-xyz --format jaeger
244
227
  ```
245
228
 
246
- See **[LLM CLI Reference](docs/LLM_CLI_REFERENCE.md)** for complete documentation of all 16 commands.
229
+ See **[LLM CLI Reference](docs/LLM_CLI_REFERENCE.md)** for complete documentation of all 17 commands.
247
230
 
248
231
  ### Visualization Modes
249
232
 
@@ -347,25 +330,20 @@ logler stats app.log --json | jq '.by_level'
347
330
  ### Investigation & Analysis
348
331
 
349
332
  ```bash
350
- # Auto-detect issues with insights
351
- logler investigate app.log --auto-insights
352
- # Output: Automatic error analysis, pattern detection, actionable suggestions
353
-
354
333
  # Analyze errors with context
355
334
  logler investigate app.log --errors
356
335
  # Shows error frequency, top error messages, time ranges
357
336
 
358
- # Find repeated patterns
359
- logler investigate app.log --patterns --min-occurrences 5
360
- # Identifies logs that repeat 5+ times
361
-
362
337
  # Follow a specific thread or request
363
338
  logler investigate app.log --thread worker-1
364
339
  logler investigate app.log --correlation req-abc123
365
340
  logler investigate app.log --trace trace-xyz789
366
341
 
342
+ # Build hierarchy tree with bottleneck detection
343
+ logler investigate app.log --correlation req-123 --hierarchy
344
+
367
345
  # Token-efficient output for LLMs
368
- logler investigate app.log --auto-insights --output summary
346
+ logler investigate app.log --errors --output summary
369
347
  # Returns aggregated statistics instead of full logs
370
348
 
371
349
  # JSON output for automation
@@ -427,7 +405,7 @@ To unlock **all** of logler's capabilities (especially multi-level thread hierar
427
405
  |-------|---------|---------|
428
406
  | `timestamp` | When the event occurred (ISO 8601) | Timeline, duration analysis |
429
407
  | `level` | Log level (DEBUG/INFO/WARN/ERROR/FATAL) | Filtering, error detection |
430
- | `message` | Human-readable description | Search, pattern detection |
408
+ | `message` | Human-readable description | Search, filtering |
431
409
  | `thread_id` | Thread/worker identifier | Thread grouping, timeline |
432
410
  | `correlation_id` | Request ID across services | Cross-service tracing |
433
411
  | `trace_id` | Distributed trace identifier | OpenTelemetry integration |
@@ -539,10 +517,36 @@ Built with:
539
517
 
540
518
  1. **Use `--follow` mode** for real-time debugging
541
519
  2. **Filter by thread** to trace execution flow
542
- 3. **Use `--auto-insights`** for automatic issue detection
520
+ 3. **Use `--hierarchy`** to visualize request flow with bottleneck detection
543
521
  4. **Export stats as JSON** for automation
544
522
  5. **Watch directories** for new log files
545
523
 
524
+ ## 🎓 Interactive Tours
525
+
526
+ Learn logler hands-on with [marimo](https://marimo.io/) notebook tours. Each tour is self-contained with sample data -- no external files needed.
527
+
528
+ ```bash
529
+ # Run any tour in your browser
530
+ uv run marimo edit examples/tours/tour_01_fundamentals.py
531
+ ```
532
+
533
+ | Tour | Topic |
534
+ |------|-------|
535
+ | 01 | Fundamentals -- search, filter, output formats |
536
+ | 02 | Thread Tracking -- grouping, correlation IDs |
537
+ | 03 | Hierarchy -- tree views, waterfall, bottleneck detection |
538
+ | 04 | Investigation -- sessions, history, report generation |
539
+ | 06 | Flamegraph -- performance visualization |
540
+ | 07 | Error Flow -- root cause analysis, propagation chains |
541
+ | 08 | Comparison -- diff hierarchies, compare threads |
542
+ | 09 | Tracing Exports -- Jaeger and Zipkin formats |
543
+ | 10 | Sampling -- smart sampling strategies |
544
+ | 12 | Multi-File -- cross-service distributed tracing |
545
+ | 13 | Live Watching -- real-time tailing and streaming |
546
+ | 14 | Performance -- 10K+ entries, benchmarks |
547
+
548
+ See the [examples README](examples/README.md) for the full learning path.
549
+
546
550
  ## 🎓 Examples
547
551
 
548
552
  ### Debug a specific request
@@ -564,10 +568,10 @@ logler view app.log -f --level ERROR
564
568
  logler view app.log --thread worker-1
565
569
  ```
566
570
 
567
- ### Investigate with insights
571
+ ### Build request hierarchy
568
572
  ```bash
569
- logler investigate app.log --auto-insights
570
- # Automatic pattern detection and issue analysis
573
+ logler investigate app.log --correlation req-123 --hierarchy
574
+ # Visualize request flow with bottleneck detection
571
575
  ```
572
576
 
573
577
  ---