Commit 366b1c5
committed
tcm: show TCM logs
Added support for showing TCM logs
@TarantoolBot
Title: Added support for showing TCM logs
This commit introduces the ability to view TCM logs using
the `tt tcm log` command.
This command works in couple with the `tt tcm start` command,
and show the logs of the TCM process that was running by it.
Command expect exists `tcm.log` file in the current directory.
**Usage example:**
```bash
tt tcm log --lines 100 --follow
```
This command will show the last 100 lines of the TCM log
file and continue to follow the log output.
This feature is useful for monitoring the TCM process.
Without the `--follow` flag, it will show the last 100 lines
of the log file and exit.
The command also supports following flags:
- `--no-color` to disable colored output
- `--no-format` to disable structured output
**Possible output:**
```text
{
time: **2025-05-29T17:19:47.905335965+03:00**
level: INFO
msg: _tcm stopped_
source: {
file: "tcm/internal/app/tcm/server/server.go",
function: "tcm/internal/server.(*TcmAPI).Close",
line: 175
}
}
{
time: **2025-05-29T17:19:47.90451709+03:00**
level: WARN
msg: _retrying of unary invoker failed_
attempt: 0,
error: "rpc error: code = Canceled desc = latest balancer error:
last connection error: connection error: desc = \"transport:
Error while dialing: dial tcp 127.0.0.1:2379: connect:
connection refused\"",
source: {
file: "go.etcd.io/etcd/client/[email protected]/retry_interceptor.go",
function: "v3.(*Client).unaryClientInterceptor.func1",
line: 63
},
target: "etcd-endpoints://0xc0003d2000/127.0.0.1:2379"
}
{
time: **2025-05-29T17:19:47.90548212+03:00**
level: ERROR
msg: _fail to get entity from etcd_
err: "context canceled",
path: "/cluster/",
source: {
file: "tcm/internal/app/tcm/server.go",
function: "tcm/internal/app/tcm/server.(*TcmAPI).validationKV",
line: 17
}
}
```
Closes #TNTP-11031 parent d7472a3 commit 366b1c5
File tree
63 files changed
+4137
-38
lines changed- cli
- cmd
- tail
- tcm
- testdata
- expected
- lib/watchdog
- test
- integration/tcm
- testdata
- expected
- json
- plain
- json
- plain
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
63 files changed
+4137
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
30 | | - | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| 42 | + | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
| |||
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
64 | 93 | | |
65 | 94 | | |
66 | 95 | | |
| |||
70 | 99 | | |
71 | 100 | | |
72 | 101 | | |
| 102 | + | |
73 | 103 | | |
74 | 104 | | |
75 | 105 | | |
76 | 106 | | |
77 | | - | |
78 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
79 | 115 | | |
80 | 116 | | |
81 | 117 | | |
| |||
90 | 126 | | |
91 | 127 | | |
92 | 128 | | |
93 | | - | |
| 129 | + | |
94 | 130 | | |
95 | 131 | | |
96 | 132 | | |
| |||
114 | 150 | | |
115 | 151 | | |
116 | 152 | | |
117 | | - | |
| 153 | + | |
118 | 154 | | |
119 | 155 | | |
120 | 156 | | |
| |||
164 | 200 | | |
165 | 201 | | |
166 | 202 | | |
167 | | - | |
| 203 | + | |
| 204 | + | |
168 | 205 | | |
169 | 206 | | |
170 | 207 | | |
171 | 208 | | |
172 | 209 | | |
173 | | - | |
| 210 | + | |
| 211 | + | |
174 | 212 | | |
175 | 213 | | |
176 | 214 | | |
177 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
0 commit comments