Using openshift rhc tail command

2019-03-19 05:53发布

How do you tail openshift log files? I issued the following command:

rhc tail myapp

It seems to show first error line and then stops, but doesn't exit. If I press ctrl+C it asks whether to stop batch or not. How can I display last few errors and may be browse page by page? Is there page down/ page up shortcuts?

5条回答
戒情不戒烟
2楼-- · 2019-03-19 06:11

The 'rhc tail' command reads the last few lines of each of your log files and continues to feed subsequent log messages to your console. To view the entire log file, please review:
https://www.openshift.com/faq/how-to-troubleshoot-application-issues-using-logs

查看更多
戒情不戒烟
3楼-- · 2019-03-19 06:15

You can also download them:

$ scp  SHA@APP-DOMAIN.rhcloud.com:/var/lib/openshift/SHA/app-root/\
logs/APP.log "~/upstream.jbossas.log"

Feasible also in windows directly in git bash.

查看更多
Anthone
4楼-- · 2019-03-19 06:16

you can see by running:

rhc tail -a yourappname -l youremail -p yourpassword
查看更多
\"骚年 ilove
5楼-- · 2019-03-19 06:18

Adding -a option fix this issue for me.

rhc tail -a {app_name}
查看更多
爱情/是我丢掉的垃圾
6楼-- · 2019-03-19 06:19

Openshift place logs in different files, so if you want get logs of a specific file then you can add -f file/address/and/name

Example :

rhc tail -f app-root/logs/nodejs.log -a myAppName

also you can ask for specific number of lines by adding -o "-n 40" in command. Above command will get last 40 lines.

Example :

rhc tail -f app-root/logs/nodejs.log -o "-n 40" -a myAppName

查看更多
登录 后发表回答