Question

When I modified the code and use cf push app-name to update my application on cloudfoundry, those log files generated by winston disappeared. Does anyone know how to solve such a problem? Thank you.

Was it helpful?

Solution

Apps running in Cloud Foundry are given an ephemeral file system, which goes away when an app is stopped and re-started, re-pushed, etc. You can't count on anything written to the file system sticking around. See http://docs.cloudfoundry.org/devguide/deploy-apps/prepare-to-deploy.html#filesystem.

You should configure your logging library to write all of its output to stdout and/or stderr. That way the logging subsystem will capture the log output. It will then be made available via "cf logs app-name", and allows the logs to be drained to external storage and analysis systems: http://docs.cloudfoundry.org/devguide/services/log-management.html.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top