Explore application logs

yarn logs <scope> or npm run logs <scope>

Gives simple access to logs from Nginx, Redis, MySQL and ElasticSearch containers and Magento.
Before magento-scripts version 1.4.1 this command will attach logs from chosen service to your terminal so to exit press CTRL + C. To attach logs use option -f.

Available scopes

  • mysql
  • nginx
  • redis
  • elasticsearch
  • magento

Command options

--details

Show extra details provided to logs
1
yarn logs nginx --details # for Yarn
2
npm run logs nginx -- --details # for NPM
Copied!

--timestamps, -t

Show timestamps
1
yarn logs nginx --timestamps # for Yarn
2
npm run logs nginx -- --timestamps # for NPM
Copied!

--follow, -f

Follow log output
1
yarn logs nginx --follow # for Yarn
2
npm run logs nginx -- --follow # for NPM
Copied!

--since

Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
1
yarn logs nginx --since=2s # for Yarn
2
npm run logs nginx -- --since=2s # for NPM
Copied!

--until

Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
1
yarn logs nginx --until=2s # for Yarn
2
npm run logs nginx -- --until=2s # for NPM
Copied!

Usage example:

1
yarn logs nginx
2
3
> ... # nginx logs
4
5
# ctrl + c
6
7
# this is not alias, but rather service name matching
8
yarn logs n # or n
9
10
> ... # nginx logs
11
12
# and for mysql
13
yarn logs m # or mysql
14
15
> ... # mysql logs
16
17
# and for magento
18
yarn logs ma # or magento
19
20
> ... # magento logs
Copied!
Last modified 4mo ago