繁体   English   中英

我如何才能将OpenShift的日志尾部添加到有关python setup.py,virtualenv和pip的详细信息?

[英]How can I tail logs from OpenShift to be verbose about python setup.py, virtualenv, and pip?

当我跑步时:

rhc tail -a myapp

我在应用程序启动时确实看到了日志消息流,但是与virtualenv的设置以及在requirements.txt中安装依赖项(例如flask等)无关。为了更好地进行调试,如何更好地在服务器上监视此消息,以防万一我遇到问题了吗? 这在Heroku中相当容易做到,但是我正在考虑将应用程序迁移到OpenShift,但前提是调试python的选项非常灵活。

当您对应用程序进行git push更改时,OpenShift会以关于setup.py,Requirements.txt等状态的详细输出进行响应。这是从部署到OpenShift上的Python应用程序的示例(缩写)输出:

$ git commit -m "Adds BeautifulSoup"
$ git push
Counting objects: 3, done.
...
remote: Stopping Python 3.3 cartridge
remote: Waiting for stop to finish
...
remote: Building git ref 'master', commit 8d92954
remote: Activating virtenv
remote: Checking for pip dependency listed in requirements.txt file..
...
remote: Collecting beautifulsoup4 (from -r /var/lib/openshift/553fde444382eca8a0000028/app-root/runtime/repo/requirements.txt (line 1))
...
remote: Downloading http://mirror1.ops.rhcloud.com/mirror/python/web/packages/source/b/beautifulsoup4/beautifulsoup4-4.3.2.tar.gz (143kB)
remote: Installing collected packages: beautifulsoup4
remote: Running setup.py install for beautifulsoup4
remote: Successfully installed beautifulsoup4-4.3.2
remote: Running setup.py script..
remote: running develop
remote: running egg_info
remote: creating YourAppName.egg-info
remote: writing top-level names to YourAppName.egg-info/top_level.txt
remote: writing YourAppName.egg-info/PKG-INFO
remote: writing dependency_links to YourAppName.egg-info/dependency_links.txt
remote: writing manifest file 'YourAppName.egg-info/SOURCES.txt'
remote: running build_ext
remote: Creating /var/lib/openshift/553fde444382eca8a0000028/app-root/runtime/dependencies/python/virtenv/venv/lib/python3.3/site-packages/YourAppName.egg-link (link to .)
remote: Adding YourAppName 1.0 to easy-install.pth file
remote: Installed /var/lib/openshift/553fde444382eca8a0000028/app-root/runtime/repo
remote: Processing dependencies for YourAppName==1.0
remote: Finished processing dependencies for YourAppName==1.0
remote: Preparing build for deployment
remote: Deployment id is d9c707fb
remote: Activating deployment
remote: Starting Python 3.3 cartridge (Apache+mod_wsgi)
remote: Application directory "/" selected as DocumentRoot
remote: Application "wsgi.py" selected as default WSGI entry point
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Activation status: success
remote: Deployment completed with status: success

在这种情况下,执行imo的最佳方法是使用ssh。 登录后,您可以进入应用程序目录并直接查看所有日志/配置文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM