0

How can I download app logs files from cloudfoundry-pivotal to local machine. Any clue or links ? can someone explain how it is possible to downloading application logs files from cloudfoundry pivotal to local machine ?

I created a jHipster application and deploy it in cloudfoundry with pivotal web services(I am using a free trial).When I check with pivotal web services web interface, I do not see where my app log files.

Hope any jHipster guy who work with PWS with coudfoundry help me.

When i build and run locally, log files generated in locally. But when i deploy in cloudfoundry and run the app, i do not see my log files in cloud server through pivotal web service web interface.

Risen Joe
  • 1
  • 1
  • 1
    Do you know where your logs are being written to? In order for CF to capture them and make them available in Apps Manager, they should be written to stdout or stderr as documented here: http://docs.cloudfoundry.org/devguide/deploy-apps/streaming-logs.html#writing – Scott Frederick Jun 09 '17 at 00:51
  • I want logs written into file. So i can download old days log files from cloud server to local machine. – Risen Joe Jun 09 '17 at 17:40
  • If you write logs to the file system then CF won't know about them. Also, the container file system is ephemeral so you will lose logs if the app crashes (see http://docs.cloudfoundry.org/devguide/deploy-apps/prepare-to-deploy.html#filesystem). You should either write logs to stdout/stderr and use a log drain to persist them (http://docs.cloudfoundry.org/devguide/services/log-management.html) or write them somewhere outside of the application container's file system. – Scott Frederick Jun 09 '17 at 19:55
  • Thanks Scott Frederick for information – Risen Joe Jun 10 '17 at 05:22

1 Answers1

1

Try this.. cf logs <app> --recent > applog.txt The text file will store in the local directory and will have all the app logs. This will work!

Kumaresh Babu N S
  • 1,648
  • 5
  • 23
  • 39