Skip to content

Commit 94692bb

Browse files
committed
fix: add -s --service to sysg logs
1 parent 566b64b commit 94692bb

File tree

15 files changed

+79
-27
lines changed

15 files changed

+79
-27
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,13 @@ $ sysg inspect myservice --no-color
293293
$ sysg logs
294294
295295
# View logs for a specific service
296-
$ sysg logs api-service
296+
$ sysg logs --service api-service
297297
298298
# View a custom number of log lines
299-
$ sysg logs database --lines 100
299+
$ sysg logs --service database --lines 100
300300
301301
# View specific log type (stdout, stderr, or supervisor)
302-
$ sysg logs myservice --kind stderr
302+
$ sysg logs --service myservice --kind stderr
303303
```
304304

305305
**Spawn** - Dynamically spawn child processes from parent services:

docs/docs/examples/crud.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ sysg restart node__web_server
154154
### View logs
155155

156156
```bash
157-
sysg logs node__web_server --follow
157+
sysg logs --service node__web_server
158158
```
159159

160160
### Manual backup
@@ -183,10 +183,10 @@ sysg cron list
183183
## Monitoring
184184

185185
```bash
186-
sysg status # Service health
187-
sysg cron status # Cron job history
188-
sysg logs automated_testing # Test results
189-
sysg logs database_backup # Backup logs
186+
sysg status # Service health
187+
sysg cron status # Cron job history
188+
sysg logs --service automated_testing # Test results
189+
sysg logs --service database_backup # Backup logs
190190
```
191191

192192
## See also

docs/docs/examples/hello-world.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ done
3232

3333
```bash
3434
sysg start
35-
sysg logs counter
35+
sysg logs --service counter
3636
sysg stop
3737
```
3838

docs/docs/examples/orchestrator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ redis-server
9595
sysg start
9696

9797
# Monitor
98-
sysg logs orchestrator -f
98+
sysg logs --service orchestrator
9999
redis-cli KEYS "*"
100100

101101
# Control

docs/docs/how-it-works/commands/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Most commands accept a service name:
4545

4646
```sh
4747
sysg restart --service api
48-
sysg logs worker
48+
sysg logs --service worker
4949
sysg stop --service redis
5050
```
5151

docs/docs/how-it-works/commands/inspect.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ sysg inspect myservice
1515

1616
| Option | Description |
1717
|--------|------------|
18-
| `--window` | Time window to display (e.g., "5s" for live, "12h" for historical). Short durations (<=60s) enable live mode with auto-refresh (default: 5s) |
18+
| `--window` | Time window to display (e.g., "5s" for live, "12h" for historical). Short durations (&lt;=60s) enable live mode with auto-refresh (default: 5s) |
1919
| `--config` | Path to configuration file |
2020
| `--json` | Emit machine-readable JSON output instead of a report |
2121
| `--sys` | Opt into privileged system mode. Requires running as root |

docs/docs/how-it-works/commands/logs.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ sysg logs
1616
| Option | Description |
1717
|--------|------------|
1818
| `--config` | Path to configuration file |
19+
| `--service` | The name of the service whose logs should be displayed (optional) |
1920
| `--lines` | Number of lines to show (default: 50) |
2021
| `--kind` | Kind of logs to show: stdout, stderr, or supervisor (default: stdout) |
2122
| `--sys` | Opt into privileged system mode. Requires running as root |
@@ -33,13 +34,13 @@ sysg logs
3334
### View logs from specific service
3435

3536
```sh
36-
sysg logs api
37+
sysg logs --service api
3738
```
3839

3940
### View stderr logs
4041

4142
```sh
42-
sysg logs --kind stderr api
43+
sysg logs --service api --kind stderr
4344
```
4445

4546
### View supervisor logs
@@ -51,7 +52,7 @@ sysg logs --kind supervisor
5152
### Show more history
5253

5354
```sh
54-
sysg logs --lines 200 api
55+
sysg logs --service api --lines 200
5556
```
5657

5758
## Log files

docs/docs/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ hello running 42309 3s
4646
## View logs
4747
4848
```bash
49-
sysg logs hello
49+
sysg logs --service hello
5050
```
5151

5252
## Stop everything

examples/crud/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ sysg status
8282
View logs for the web server:
8383

8484
```bash
85-
sysg logs node__web_server
85+
sysg logs --service node__web_server
8686
```
8787

8888
### Stop Services

examples/hello-world/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ sysg status
6060
6161
### View logs:
6262
```bash
63-
sysg logs sh__hello_world
63+
sysg logs --service sh__hello_world
6464
```
6565

6666
### Expected log output:

0 commit comments

Comments
 (0)