Node.js OpsWorks Layer控制台日志 [英] Node.js OpsWorks Layer console logs

查看:102
本文介绍了Node.js OpsWorks Layer控制台日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有Node.js层和Node.js应用程序的Opsworks堆栈。我想知道是否有人知道ubuntu 14.04LTS实例上应用程序控制台日志的打印位置。我知道opsworks使用monit运行我的应用程序,但是我不确定它将日志输出到哪里。

I have an Opsworks stack with a Node.js Layer and Node.js Application. I'm wondering if anyone knows where on an ubuntu 14.04LTS instance the console logs from my application are being printed to. I know the opsworks uses monit to run my application but I'm not sure where its outputting the logs to.

谢谢!

推荐答案

非常烦人的是,为Opsworks上的Node.JS应用渲染的Monit配置不会将输出发送到任何地方! 此声明的来源 。 (当我了解它时,这使我感到惊讶!)

So annoyingly enough, the Monit configuration rendered for Node.JS apps on Opsworks doesn't send the output anywhere! Source for this claim. (This surprised me when I learned about it!)

我建议做的是覆盖该模板-请参见有关覆盖模板的OpsWorks文档:基本上,您需要做的就是从Amazon复制粘贴Monit配置,但更改第2行以进行重定向输出到文件,就像我在下面这样:

What I recommend doing is overriding that template - see the OpsWorks documentation on overriding templates: essentially all you need to do is copy paste the Monit config from Amazon, but change line 2 to redirect the output to a file, like I do below so:

开始程序= / bin / bash -c'cd<%= @ deploy [:deploy_to]%> / current;源<%= @deploy [:deploy_to]%> /shared/app.env; / usr / bin / env PATH = $ PATH:/ usr / local / bin PORT =<%= @deploy [:nodejs] [:port]%> NODE_PATH =<%= @deploy [:deploy_to]%> / current / node_modules:<%= @deploy [:deploy_to]%> ; / current / usr / local / bin / node<%= @monitored_script%>&><%= @deploy [:deploy_to]%> /current/log/production.log'

这篇关于Node.js OpsWorks Layer控制台日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆