feat: allow tailing a specific number of log lines

This commit is contained in:
Jose Diaz-Gonzalez
2021-10-26 22:27:13 -04:00
parent c44089527f
commit 529d339ee5
4 changed files with 20 additions and 9 deletions

View File

@@ -41,7 +41,7 @@ mongo:link <service> <app> [--link-flags...] # link the mongo service to t
mongo:linked <service> <app> # check if the mongo service is linked to an app
mongo:links <service> # list all apps linked to the mongo service
mongo:list # list all mongo services
mongo:logs <service> [-t|--tail] # print the most recent log(s) for this service
mongo:logs <service> [-t|--tail] <tail-num-optional> # print the most recent log(s) for this service
mongo:promote <service> <app> # promote service <service> as MONGO_URL in <app>
mongo:restart <service> # graceful shutdown and restart of the mongo service container
mongo:start <service> # start a previously stopped mongo service
@@ -154,12 +154,12 @@ dokku mongo:list
```shell
# usage
dokku mongo:logs <service> [-t|--tail]
dokku mongo:logs <service> [-t|--tail] <tail-num-optional>
```
flags:
- `-t|--tail`: do not stop when end of the logs are reached and wait for additional output
- `-t|--tail [<tail-num>]`: do not stop when end of the logs are reached and wait for additional output
You can tail logs for a particular service:
@@ -173,6 +173,12 @@ By default, logs will not be tailed, but you can do this with the --tail flag:
dokku mongo:logs lollipop --tail
```
The default tail setting is to show all logs, but an initial count can also be specified:
```shell
dokku mongo:logs lollipop --tail 5
```
### link the mongo service to the app
```shell