Using openshift rhc tail command

13,738

Solution 1

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

Solution 2

you can see by running:

rhc tail -a yourappname -l youremail -p yourpassword

Solution 3

Adding -a option fix this issue for me.

rhc tail -a {app_name}

Solution 4

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

Share:
13,738

Related videos on Youtube

synergetic
Author by

synergetic

Updated on June 04, 2022

Comments

  • synergetic
    synergetic almost 2 years

    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?

  • Mr_and_Mrs_D
    Mr_and_Mrs_D almost 10 years
    Went there but left wondering how to download them - I use notepad++ and I'd rather edit them locally - add that info there please (see my answer)
  • Stijn de Witt
    Stijn de Witt about 7 years
    This works, but shows logs 'live'. Can be handy when something goes wrong; issue this command then execute the failing action and watch the logs as they are written. If you just want to browse log files, either ssh into the server and view logs there (using cat, tail, grep, vi etc) or (my personal favorite) configure FTP over ssh and just download the log files and open in your favorite editor.