logler 1.1.2__tar.gz → 1.1.3__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.
- {logler-1.1.2 → logler-1.1.3}/Cargo.lock +12 -12
- {logler-1.1.2 → logler-1.1.3}/Cargo.toml +1 -1
- {logler-1.1.2 → logler-1.1.3}/PKG-INFO +95 -18
- {logler-1.1.2 → logler-1.1.3}/README.md +94 -17
- {logler-1.1.2 → logler-1.1.3}/crates/logler-core/src/hierarchy.rs +99 -29
- {logler-1.1.2 → logler-1.1.3}/crates/logler-core/src/investigate.rs +2 -1
- {logler-1.1.2 → logler-1.1.3}/pyproject.toml +1 -1
- {logler-1.1.2 → logler-1.1.3}/src/logler/cli.py +19 -8
- {logler-1.1.2 → logler-1.1.3}/src/logler/investigate.py +26 -9
- {logler-1.1.2 → logler-1.1.3}/src/logler/llm_cli.py +301 -3
- {logler-1.1.2 → logler-1.1.3}/src/logler/models.py +4 -0
- {logler-1.1.2 → logler-1.1.3}/src/logler/parser.py +3 -0
- {logler-1.1.2 → logler-1.1.3}/src/logler/tree_formatter.py +26 -5
- {logler-1.1.2 → logler-1.1.3}/LICENSE +0 -0
- {logler-1.1.2 → logler-1.1.3}/crates/logler-core/Cargo.toml +0 -0
- {logler-1.1.2 → logler-1.1.3}/crates/logler-core/src/filter.rs +0 -0
- {logler-1.1.2 → logler-1.1.3}/crates/logler-core/src/index.rs +0 -0
- {logler-1.1.2 → logler-1.1.3}/crates/logler-core/src/lib.rs +0 -0
- {logler-1.1.2 → logler-1.1.3}/crates/logler-core/src/parser.rs +0 -0
- {logler-1.1.2 → logler-1.1.3}/crates/logler-core/src/reader.rs +0 -0
- {logler-1.1.2 → logler-1.1.3}/crates/logler-core/src/stats.rs +0 -0
- {logler-1.1.2 → logler-1.1.3}/crates/logler-core/src/thread_tracker.rs +0 -0
- {logler-1.1.2 → logler-1.1.3}/crates/logler-core/src/trace.rs +0 -0
- {logler-1.1.2 → logler-1.1.3}/crates/logler-core/src/types.rs +0 -0
- {logler-1.1.2 → logler-1.1.3}/crates/logler-py/Cargo.toml +0 -0
- {logler-1.1.2 → logler-1.1.3}/crates/logler-py/src/lib.rs +0 -0
- {logler-1.1.2 → logler-1.1.3}/src/logler/__init__.py +0 -0
- {logler-1.1.2 → logler-1.1.3}/src/logler/bootstrap.py +0 -0
- {logler-1.1.2 → logler-1.1.3}/src/logler/cache.py +0 -0
- {logler-1.1.2 → logler-1.1.3}/src/logler/helpers.py +0 -0
- {logler-1.1.2 → logler-1.1.3}/src/logler/log_reader.py +0 -0
- {logler-1.1.2 → logler-1.1.3}/src/logler/safe_regex.py +0 -0
- {logler-1.1.2 → logler-1.1.3}/src/logler/sql.py +0 -0
- {logler-1.1.2 → logler-1.1.3}/src/logler/terminal.py +0 -0
- {logler-1.1.2 → logler-1.1.3}/src/logler/tracker.py +0 -0
- {logler-1.1.2 → logler-1.1.3}/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.
|
|
256
|
+
version = "1.2.54"
|
|
257
257
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
258
|
-
checksum = "
|
|
258
|
+
checksum = "6354c81bbfd62d9cfa9cb3c773c2b7b2a3a482d569de977fd0e961f6e7c00583"
|
|
259
259
|
dependencies = [
|
|
260
260
|
"find-msvc-tools",
|
|
261
261
|
"shlex",
|
|
@@ -953,7 +953,7 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
|
|
|
953
953
|
|
|
954
954
|
[[package]]
|
|
955
955
|
name = "logler-cli"
|
|
956
|
-
version = "1.1.
|
|
956
|
+
version = "1.1.3"
|
|
957
957
|
dependencies = [
|
|
958
958
|
"anyhow",
|
|
959
959
|
"clap",
|
|
@@ -968,7 +968,7 @@ dependencies = [
|
|
|
968
968
|
|
|
969
969
|
[[package]]
|
|
970
970
|
name = "logler-core"
|
|
971
|
-
version = "1.1.
|
|
971
|
+
version = "1.1.3"
|
|
972
972
|
dependencies = [
|
|
973
973
|
"anyhow",
|
|
974
974
|
"async-stream",
|
|
@@ -992,7 +992,7 @@ dependencies = [
|
|
|
992
992
|
|
|
993
993
|
[[package]]
|
|
994
994
|
name = "logler-py"
|
|
995
|
-
version = "1.1.
|
|
995
|
+
version = "1.1.3"
|
|
996
996
|
dependencies = [
|
|
997
997
|
"anyhow",
|
|
998
998
|
"logler-core",
|
|
@@ -1004,7 +1004,7 @@ dependencies = [
|
|
|
1004
1004
|
|
|
1005
1005
|
[[package]]
|
|
1006
1006
|
name = "logler-server"
|
|
1007
|
-
version = "1.1.
|
|
1007
|
+
version = "1.1.3"
|
|
1008
1008
|
dependencies = [
|
|
1009
1009
|
"anyhow",
|
|
1010
1010
|
"axum",
|
|
@@ -1306,9 +1306,9 @@ dependencies = [
|
|
|
1306
1306
|
|
|
1307
1307
|
[[package]]
|
|
1308
1308
|
name = "quote"
|
|
1309
|
-
version = "1.0.
|
|
1309
|
+
version = "1.0.44"
|
|
1310
1310
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1311
|
-
checksum = "
|
|
1311
|
+
checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4"
|
|
1312
1312
|
dependencies = [
|
|
1313
1313
|
"proc-macro2",
|
|
1314
1314
|
]
|
|
@@ -1572,9 +1572,9 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
|
|
|
1572
1572
|
|
|
1573
1573
|
[[package]]
|
|
1574
1574
|
name = "socket2"
|
|
1575
|
-
version = "0.6.
|
|
1575
|
+
version = "0.6.2"
|
|
1576
1576
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1577
|
-
checksum = "
|
|
1577
|
+
checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0"
|
|
1578
1578
|
dependencies = [
|
|
1579
1579
|
"libc",
|
|
1580
1580
|
"windows-sys 0.60.2",
|
|
@@ -1888,9 +1888,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
|
|
1888
1888
|
|
|
1889
1889
|
[[package]]
|
|
1890
1890
|
name = "uuid"
|
|
1891
|
-
version = "1.
|
|
1891
|
+
version = "1.20.0"
|
|
1892
1892
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1893
|
-
checksum = "
|
|
1893
|
+
checksum = "ee48d38b119b0cd71fe4141b30f5ba9c7c5d9f4e7a3a8b4a674e4b6ef789976f"
|
|
1894
1894
|
dependencies = [
|
|
1895
1895
|
"getrandom 0.3.4",
|
|
1896
1896
|
"js-sys",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: logler
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.3
|
|
4
4
|
Classifier: Development Status :: 4 - Beta
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -92,75 +92,116 @@ A modern, feature-rich log viewer that makes debugging a pleasure. View logs in
|
|
|
92
92
|
- 🤔 **Explain Feature** - Plain English explanations of cryptic errors with next steps
|
|
93
93
|
- 💬 **Contextual Suggestions** - AI suggests what to investigate next based on findings
|
|
94
94
|
|
|
95
|
+
### Public API Contract
|
|
96
|
+
|
|
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
|
|
95
100
|
```python
|
|
96
101
|
import logler.investigate as investigate
|
|
97
102
|
|
|
98
|
-
# 🎯 One-line auto investigation with insights
|
|
99
103
|
result = investigate.analyze_with_insights(files=["app.log"])
|
|
100
104
|
print(result['insights']) # Automatic pattern detection, error analysis, suggestions
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
#### [C02] Token-efficient search
|
|
108
|
+
```python
|
|
109
|
+
import logler.investigate as investigate
|
|
101
110
|
|
|
102
|
-
# 📉 Token-efficient search (44x smaller output)
|
|
103
111
|
errors = investigate.search(files=["app.log"], level="ERROR", output_format="summary")
|
|
104
112
|
# Returns aggregated stats instead of all entries - perfect for limited context windows
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### [C03] Compare threads
|
|
116
|
+
```python
|
|
117
|
+
import logler.investigate as investigate
|
|
105
118
|
|
|
106
|
-
# 🔀 Compare successful vs failed requests
|
|
107
119
|
diff = investigate.compare_threads(
|
|
108
120
|
files=["app.log"],
|
|
109
121
|
correlation_a="req-success-123",
|
|
110
122
|
correlation_b="req-failed-456"
|
|
111
123
|
)
|
|
112
|
-
print(diff['summary']) #
|
|
124
|
+
print(diff['summary']) # Comparison of two request flows
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
#### [C04] Cross-service timeline
|
|
128
|
+
```python
|
|
129
|
+
import logler.investigate as investigate
|
|
113
130
|
|
|
114
|
-
# 🌐 Cross-service distributed tracing
|
|
115
131
|
timeline = investigate.cross_service_timeline(
|
|
116
132
|
files={"api": ["api.log"], "db": ["db.log"], "cache": ["cache.log"]},
|
|
117
133
|
correlation_id="req-12345"
|
|
118
134
|
)
|
|
119
135
|
# See request flow: API → DB → Cache with latency breakdown
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
#### [C05] Investigation sessions
|
|
139
|
+
```python
|
|
140
|
+
import logler.investigate as investigate
|
|
120
141
|
|
|
121
|
-
# 📝 Track investigation with sessions
|
|
122
142
|
session = investigate.InvestigationSession(files=["app.log"], name="incident_2024")
|
|
123
143
|
session.search(level="ERROR")
|
|
124
144
|
session.find_patterns()
|
|
125
145
|
session.add_note("Database connection pool exhausted")
|
|
126
146
|
report = session.generate_report(format="markdown") # Auto-generate report
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
#### [C06] Smart sampling
|
|
150
|
+
```python
|
|
151
|
+
import logler.investigate as investigate
|
|
127
152
|
|
|
128
|
-
# 🎯 Smart sampling (representative sample of huge logs)
|
|
129
153
|
sample = investigate.smart_sample(
|
|
130
154
|
files=["huge.log"],
|
|
131
155
|
strategy="errors_focused", # or "diverse", "representative", "chronological"
|
|
132
156
|
sample_size=50
|
|
133
157
|
)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
#### [C07] Error explanation
|
|
161
|
+
```python
|
|
162
|
+
import logler.investigate as investigate
|
|
134
163
|
|
|
135
|
-
# 🤔 Explain cryptic errors in plain English
|
|
136
164
|
explanation = investigate.explain(error_message="Connection pool exhausted", context="production")
|
|
137
165
|
print(explanation) # Common causes, next steps, production-specific advice
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
#### [C08] Thread hierarchy
|
|
169
|
+
```python
|
|
170
|
+
import logler.investigate as investigate
|
|
138
171
|
|
|
139
|
-
# 🌳 Hierarchical thread visualization (NEW!)
|
|
140
172
|
hierarchy = investigate.follow_thread_hierarchy(
|
|
141
173
|
files=["app.log"],
|
|
142
174
|
root_identifier="req-123",
|
|
143
175
|
min_confidence=0.8 # Only show high-confidence relationships
|
|
144
176
|
)
|
|
145
|
-
|
|
146
177
|
# Automatic bottleneck detection
|
|
147
|
-
if hierarchy
|
|
178
|
+
if hierarchy.get('bottleneck'):
|
|
148
179
|
print(f"Bottleneck: {hierarchy['bottleneck']['node_id']} took {hierarchy['bottleneck']['duration_ms']}ms")
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
#### [C09] Hierarchy summary
|
|
183
|
+
```python
|
|
184
|
+
import logler.investigate as investigate
|
|
149
185
|
|
|
150
|
-
#
|
|
186
|
+
# Using hierarchy from [C08]
|
|
151
187
|
summary = investigate.get_hierarchy_summary(hierarchy)
|
|
152
188
|
print(summary) # Shows tree structure, errors, bottlenecks
|
|
189
|
+
```
|
|
153
190
|
|
|
154
|
-
|
|
191
|
+
#### [C10] Tree visualization
|
|
192
|
+
```python
|
|
155
193
|
from logler.tree_formatter import print_tree, print_waterfall
|
|
194
|
+
|
|
195
|
+
# Using hierarchy from [C08]
|
|
156
196
|
print_tree(hierarchy, mode="detailed", show_duration=True)
|
|
157
|
-
print_waterfall(hierarchy, width=100) # Waterfall timeline
|
|
197
|
+
print_waterfall(hierarchy, width=100) # Waterfall timeline
|
|
158
198
|
```
|
|
159
199
|
|
|
160
200
|
**📚 Complete LLM documentation:**
|
|
161
|
-
- [
|
|
201
|
+
- [LLM CLI Reference](docs/LLM_CLI_REFERENCE.md) - All 16 CLI commands for AI agents
|
|
202
|
+
- [Python API Guide](docs/LLM_README.md) - Library API and examples
|
|
203
|
+
- [API Reference](docs/LLM_INVESTIGATION_API.md) - All investigation functions
|
|
162
204
|
- [日本語ガイド](README.ja.md) - 完全なドキュメント
|
|
163
|
-
- [API Reference](docs/LLM_INVESTIGATION_API.md) - All investigation tools
|
|
164
205
|
- [Examples](examples/) - Production incident investigations
|
|
165
206
|
|
|
166
207
|
## 🚀 Quick Start
|
|
@@ -200,16 +241,48 @@ logler investigate app.log --errors # Analyze errors
|
|
|
200
241
|
logler investigate app.log --patterns # Find repeated patterns
|
|
201
242
|
logler investigate app.log --thread worker-1 # Follow specific thread
|
|
202
243
|
logler investigate app.log --correlation req-123 # Follow correlation ID
|
|
244
|
+
logler investigate app.log --trace trace-abc123 # Follow distributed trace
|
|
203
245
|
logler investigate app.log --output summary # Token-efficient output
|
|
204
246
|
|
|
205
247
|
# 🌳 NEW: Hierarchical Thread Visualization
|
|
206
248
|
logler investigate app.log --correlation req-123 --hierarchy # Show thread hierarchy tree
|
|
207
|
-
logler investigate app.log --
|
|
249
|
+
logler investigate app.log --trace trace-abc123 --hierarchy --waterfall # Show waterfall timeline
|
|
208
250
|
logler investigate app.log --correlation req-123 --hierarchy --flamegraph # Show flamegraph view
|
|
209
251
|
logler investigate app.log --hierarchy --show-error-flow # Analyze error propagation
|
|
210
252
|
logler investigate app.log --thread worker-1 --hierarchy --max-depth 3 # Limit hierarchy depth
|
|
211
253
|
```
|
|
212
254
|
|
|
255
|
+
**LLM-first CLI (JSON output by default):**
|
|
256
|
+
|
|
257
|
+
Designed for AI agents - 16 commands with structured JSON output, no truncation.
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# Assessment & Overview
|
|
261
|
+
logler llm triage app.log --last 1h # Quick severity assessment
|
|
262
|
+
logler llm summarize app.log # Concise summary with stats
|
|
263
|
+
logler llm schema app.log # Infer log structure
|
|
264
|
+
|
|
265
|
+
# Search & Analysis
|
|
266
|
+
logler llm search app.log --level ERROR # Find entries (full results)
|
|
267
|
+
logler llm sql "SELECT level, COUNT(*) FROM logs GROUP BY level" -f app.log
|
|
268
|
+
|
|
269
|
+
# Request Tracing
|
|
270
|
+
logler llm correlate req-123 --files "*.log" # Follow correlation ID
|
|
271
|
+
logler llm hierarchy trace-xyz --files "*.log" # Build hierarchy tree
|
|
272
|
+
logler llm bottleneck trace-xyz --files "*.log" # Find slow operations
|
|
273
|
+
|
|
274
|
+
# Comparison
|
|
275
|
+
logler llm compare req-fail req-success --files "*.log" # Compare requests
|
|
276
|
+
logler llm diff app.log --baseline 1h # Before/after analysis
|
|
277
|
+
|
|
278
|
+
# Utilities
|
|
279
|
+
logler llm sample app.log --strategy errors_focused --size 50
|
|
280
|
+
logler llm context app.log 1523 --before 10 --after 10
|
|
281
|
+
logler llm export trace-xyz --format jaeger
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
See **[LLM CLI Reference](docs/LLM_CLI_REFERENCE.md)** for complete documentation of all 16 commands.
|
|
285
|
+
|
|
213
286
|
### Visualization Modes
|
|
214
287
|
|
|
215
288
|
**Tree View** - Shows parent-child relationships:
|
|
@@ -327,6 +400,7 @@ logler investigate app.log --patterns --min-occurrences 5
|
|
|
327
400
|
# Follow a specific thread or request
|
|
328
401
|
logler investigate app.log --thread worker-1
|
|
329
402
|
logler investigate app.log --correlation req-abc123
|
|
403
|
+
logler investigate app.log --trace trace-xyz789
|
|
330
404
|
|
|
331
405
|
# Token-efficient output for LLMs
|
|
332
406
|
logler investigate app.log --auto-insights --output summary
|
|
@@ -437,6 +511,9 @@ Track requests across services:
|
|
|
437
511
|
# Follow a specific correlation ID
|
|
438
512
|
logler investigate app.log --correlation req-12345
|
|
439
513
|
|
|
514
|
+
# Follow a distributed trace ID
|
|
515
|
+
logler investigate app.log --trace trace-xyz789
|
|
516
|
+
|
|
440
517
|
# View across multiple service logs
|
|
441
518
|
logler view app.log service.log --grep "req-12345"
|
|
442
519
|
```
|
|
@@ -54,75 +54,116 @@ A modern, feature-rich log viewer that makes debugging a pleasure. View logs in
|
|
|
54
54
|
- 🤔 **Explain Feature** - Plain English explanations of cryptic errors with next steps
|
|
55
55
|
- 💬 **Contextual Suggestions** - AI suggests what to investigate next based on findings
|
|
56
56
|
|
|
57
|
+
### Public API Contract
|
|
58
|
+
|
|
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
|
|
57
62
|
```python
|
|
58
63
|
import logler.investigate as investigate
|
|
59
64
|
|
|
60
|
-
# 🎯 One-line auto investigation with insights
|
|
61
65
|
result = investigate.analyze_with_insights(files=["app.log"])
|
|
62
66
|
print(result['insights']) # Automatic pattern detection, error analysis, suggestions
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
#### [C02] Token-efficient search
|
|
70
|
+
```python
|
|
71
|
+
import logler.investigate as investigate
|
|
63
72
|
|
|
64
|
-
# 📉 Token-efficient search (44x smaller output)
|
|
65
73
|
errors = investigate.search(files=["app.log"], level="ERROR", output_format="summary")
|
|
66
74
|
# Returns aggregated stats instead of all entries - perfect for limited context windows
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
#### [C03] Compare threads
|
|
78
|
+
```python
|
|
79
|
+
import logler.investigate as investigate
|
|
67
80
|
|
|
68
|
-
# 🔀 Compare successful vs failed requests
|
|
69
81
|
diff = investigate.compare_threads(
|
|
70
82
|
files=["app.log"],
|
|
71
83
|
correlation_a="req-success-123",
|
|
72
84
|
correlation_b="req-failed-456"
|
|
73
85
|
)
|
|
74
|
-
print(diff['summary']) #
|
|
86
|
+
print(diff['summary']) # Comparison of two request flows
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
#### [C04] Cross-service timeline
|
|
90
|
+
```python
|
|
91
|
+
import logler.investigate as investigate
|
|
75
92
|
|
|
76
|
-
# 🌐 Cross-service distributed tracing
|
|
77
93
|
timeline = investigate.cross_service_timeline(
|
|
78
94
|
files={"api": ["api.log"], "db": ["db.log"], "cache": ["cache.log"]},
|
|
79
95
|
correlation_id="req-12345"
|
|
80
96
|
)
|
|
81
97
|
# See request flow: API → DB → Cache with latency breakdown
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### [C05] Investigation sessions
|
|
101
|
+
```python
|
|
102
|
+
import logler.investigate as investigate
|
|
82
103
|
|
|
83
|
-
# 📝 Track investigation with sessions
|
|
84
104
|
session = investigate.InvestigationSession(files=["app.log"], name="incident_2024")
|
|
85
105
|
session.search(level="ERROR")
|
|
86
106
|
session.find_patterns()
|
|
87
107
|
session.add_note("Database connection pool exhausted")
|
|
88
108
|
report = session.generate_report(format="markdown") # Auto-generate report
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
#### [C06] Smart sampling
|
|
112
|
+
```python
|
|
113
|
+
import logler.investigate as investigate
|
|
89
114
|
|
|
90
|
-
# 🎯 Smart sampling (representative sample of huge logs)
|
|
91
115
|
sample = investigate.smart_sample(
|
|
92
116
|
files=["huge.log"],
|
|
93
117
|
strategy="errors_focused", # or "diverse", "representative", "chronological"
|
|
94
118
|
sample_size=50
|
|
95
119
|
)
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
#### [C07] Error explanation
|
|
123
|
+
```python
|
|
124
|
+
import logler.investigate as investigate
|
|
96
125
|
|
|
97
|
-
# 🤔 Explain cryptic errors in plain English
|
|
98
126
|
explanation = investigate.explain(error_message="Connection pool exhausted", context="production")
|
|
99
127
|
print(explanation) # Common causes, next steps, production-specific advice
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
#### [C08] Thread hierarchy
|
|
131
|
+
```python
|
|
132
|
+
import logler.investigate as investigate
|
|
100
133
|
|
|
101
|
-
# 🌳 Hierarchical thread visualization (NEW!)
|
|
102
134
|
hierarchy = investigate.follow_thread_hierarchy(
|
|
103
135
|
files=["app.log"],
|
|
104
136
|
root_identifier="req-123",
|
|
105
137
|
min_confidence=0.8 # Only show high-confidence relationships
|
|
106
138
|
)
|
|
107
|
-
|
|
108
139
|
# Automatic bottleneck detection
|
|
109
|
-
if hierarchy
|
|
140
|
+
if hierarchy.get('bottleneck'):
|
|
110
141
|
print(f"Bottleneck: {hierarchy['bottleneck']['node_id']} took {hierarchy['bottleneck']['duration_ms']}ms")
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
#### [C09] Hierarchy summary
|
|
145
|
+
```python
|
|
146
|
+
import logler.investigate as investigate
|
|
111
147
|
|
|
112
|
-
#
|
|
148
|
+
# Using hierarchy from [C08]
|
|
113
149
|
summary = investigate.get_hierarchy_summary(hierarchy)
|
|
114
150
|
print(summary) # Shows tree structure, errors, bottlenecks
|
|
151
|
+
```
|
|
115
152
|
|
|
116
|
-
|
|
153
|
+
#### [C10] Tree visualization
|
|
154
|
+
```python
|
|
117
155
|
from logler.tree_formatter import print_tree, print_waterfall
|
|
156
|
+
|
|
157
|
+
# Using hierarchy from [C08]
|
|
118
158
|
print_tree(hierarchy, mode="detailed", show_duration=True)
|
|
119
|
-
print_waterfall(hierarchy, width=100) # Waterfall timeline
|
|
159
|
+
print_waterfall(hierarchy, width=100) # Waterfall timeline
|
|
120
160
|
```
|
|
121
161
|
|
|
122
162
|
**📚 Complete LLM documentation:**
|
|
123
|
-
- [
|
|
163
|
+
- [LLM CLI Reference](docs/LLM_CLI_REFERENCE.md) - All 16 CLI commands for AI agents
|
|
164
|
+
- [Python API Guide](docs/LLM_README.md) - Library API and examples
|
|
165
|
+
- [API Reference](docs/LLM_INVESTIGATION_API.md) - All investigation functions
|
|
124
166
|
- [日本語ガイド](README.ja.md) - 完全なドキュメント
|
|
125
|
-
- [API Reference](docs/LLM_INVESTIGATION_API.md) - All investigation tools
|
|
126
167
|
- [Examples](examples/) - Production incident investigations
|
|
127
168
|
|
|
128
169
|
## 🚀 Quick Start
|
|
@@ -162,16 +203,48 @@ logler investigate app.log --errors # Analyze errors
|
|
|
162
203
|
logler investigate app.log --patterns # Find repeated patterns
|
|
163
204
|
logler investigate app.log --thread worker-1 # Follow specific thread
|
|
164
205
|
logler investigate app.log --correlation req-123 # Follow correlation ID
|
|
206
|
+
logler investigate app.log --trace trace-abc123 # Follow distributed trace
|
|
165
207
|
logler investigate app.log --output summary # Token-efficient output
|
|
166
208
|
|
|
167
209
|
# 🌳 NEW: Hierarchical Thread Visualization
|
|
168
210
|
logler investigate app.log --correlation req-123 --hierarchy # Show thread hierarchy tree
|
|
169
|
-
logler investigate app.log --
|
|
211
|
+
logler investigate app.log --trace trace-abc123 --hierarchy --waterfall # Show waterfall timeline
|
|
170
212
|
logler investigate app.log --correlation req-123 --hierarchy --flamegraph # Show flamegraph view
|
|
171
213
|
logler investigate app.log --hierarchy --show-error-flow # Analyze error propagation
|
|
172
214
|
logler investigate app.log --thread worker-1 --hierarchy --max-depth 3 # Limit hierarchy depth
|
|
173
215
|
```
|
|
174
216
|
|
|
217
|
+
**LLM-first CLI (JSON output by default):**
|
|
218
|
+
|
|
219
|
+
Designed for AI agents - 16 commands with structured JSON output, no truncation.
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
# Assessment & Overview
|
|
223
|
+
logler llm triage app.log --last 1h # Quick severity assessment
|
|
224
|
+
logler llm summarize app.log # Concise summary with stats
|
|
225
|
+
logler llm schema app.log # Infer log structure
|
|
226
|
+
|
|
227
|
+
# Search & Analysis
|
|
228
|
+
logler llm search app.log --level ERROR # Find entries (full results)
|
|
229
|
+
logler llm sql "SELECT level, COUNT(*) FROM logs GROUP BY level" -f app.log
|
|
230
|
+
|
|
231
|
+
# Request Tracing
|
|
232
|
+
logler llm correlate req-123 --files "*.log" # Follow correlation ID
|
|
233
|
+
logler llm hierarchy trace-xyz --files "*.log" # Build hierarchy tree
|
|
234
|
+
logler llm bottleneck trace-xyz --files "*.log" # Find slow operations
|
|
235
|
+
|
|
236
|
+
# Comparison
|
|
237
|
+
logler llm compare req-fail req-success --files "*.log" # Compare requests
|
|
238
|
+
logler llm diff app.log --baseline 1h # Before/after analysis
|
|
239
|
+
|
|
240
|
+
# Utilities
|
|
241
|
+
logler llm sample app.log --strategy errors_focused --size 50
|
|
242
|
+
logler llm context app.log 1523 --before 10 --after 10
|
|
243
|
+
logler llm export trace-xyz --format jaeger
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
See **[LLM CLI Reference](docs/LLM_CLI_REFERENCE.md)** for complete documentation of all 16 commands.
|
|
247
|
+
|
|
175
248
|
### Visualization Modes
|
|
176
249
|
|
|
177
250
|
**Tree View** - Shows parent-child relationships:
|
|
@@ -289,6 +362,7 @@ logler investigate app.log --patterns --min-occurrences 5
|
|
|
289
362
|
# Follow a specific thread or request
|
|
290
363
|
logler investigate app.log --thread worker-1
|
|
291
364
|
logler investigate app.log --correlation req-abc123
|
|
365
|
+
logler investigate app.log --trace trace-xyz789
|
|
292
366
|
|
|
293
367
|
# Token-efficient output for LLMs
|
|
294
368
|
logler investigate app.log --auto-insights --output summary
|
|
@@ -399,6 +473,9 @@ Track requests across services:
|
|
|
399
473
|
# Follow a specific correlation ID
|
|
400
474
|
logler investigate app.log --correlation req-12345
|
|
401
475
|
|
|
476
|
+
# Follow a distributed trace ID
|
|
477
|
+
logler investigate app.log --trace trace-xyz789
|
|
478
|
+
|
|
402
479
|
# View across multiple service logs
|
|
403
480
|
logler view app.log service.log --grep "req-12345"
|
|
404
481
|
```
|