當我運行:我如何從OpenShift尾部日誌詳細瞭解python setup.py,virtualenv和pip?
rhc tail -a myapp
我看到在應用程序啓動的日誌信息流,但沒有有關相關的requirements.txt的virtualenv中安裝的設置,如燒瓶等我怎樣才能更好爲了調試的目的,在服務器上監控它,以防萬一遇到問題?在Heroku中這很容易實現,但我正在考慮將應用程序遷移到OpenShift,但前提是調試python的選項非常靈活。
當我運行:我如何從OpenShift尾部日誌詳細瞭解python setup.py,virtualenv和pip?
rhc tail -a myapp
我看到在應用程序啓動的日誌信息流,但沒有有關相關的requirements.txt的virtualenv中安裝的設置,如燒瓶等我怎樣才能更好爲了調試的目的,在服務器上監控它,以防萬一遇到問題?在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
在這種情況下做最好的事情就是把你的裝備ssh。登錄後,您可以切換到應用程序目錄並直接查看所有日誌/配置文件。
能夠在本地執行日誌記錄是非常高興的。因爲我可以使用上面的命令從服務器上掛起日誌,所以邏輯上它必須是某種類型的設置,它只是簡單地使輸出變得冗長。爲什麼rhc會包含「tail」命令? – Hexatonic
是的,你是100%的權利。我很忙,看着我的尾巴日誌,我忘了在我的另一個窗口窗口看這個......呃! ;) – Hexatonic
接受答案,如果你有機會,試圖通過1k代表堆棧:)我的方式工作 – luciddreamz
奧普斯,對不起。無意中,我點擊了4月30日的向上箭頭而不是複選標記。這是一個很好的複選標記。感謝提醒luciddreamz :) – Hexatonic