我最近開始使用Openshift,到目前爲止它一直很棒。我目前的問題在於我的調試日誌沒有顯示在Openshift的日誌中。我曾經使用DEBUG=*,-express:* node ./bin/www
在本地運行應用程序,它顯示了我需要的一切。到目前爲止,我還沒有想到如何將其轉換爲package.json
文件,以便它按預期工作。在Openshift上運行debug node_module
package.json
{
"name": "APP",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "DEBUG=*,-express:* node ./bin/www"
},
"main": "./bin/www",
"dependencies": { ... }
在我看來,它正在運行與main
數據node
命令,而不是我的非常優選的腳本。我相信調試模塊是我的代碼上發送垃圾郵件console.log()
的好選擇。
在OpenShift日誌文件上,它啓動應用程序時顯示以下內容。這是我的理解,我期待找到--exec和改變。
DEBUG: Running node-supervisor with
DEBUG: program './bin/www'
DEBUG: --watch '/var/lib/openshift/<app_ID>/app-root/data/.nodewatch'
DEBUG: --ignore 'undefined'
DEBUG: --extensions 'node|js|coffee'
DEBUG: --exec 'node'
DEBUG: Starting child process with 'node ./bin/www'