在Elastic beanstalk中部署的Rails应用程序的Logentires配置

时间:2018-06-25 03:49:18

标签: ruby-on-rails configuration elastic-beanstalk logentries

我将为在弹性beantalk中部署的rails项目设置登录项。 这是配置文件

files:
  "/etc/yum.repos.d/logentries.repo" :
    mode: "000664"
    owner: root
    group: root
    content: |
      [logentries]
      name=Logentries repo
      enabled=1
      metadata_expire=1d
      baseurl=http://rep.logentries.com/amazonlatest/\$basearch
      gpgkey=http://rep.logentries.com/RPM-GPG-KEY-logentries
    encoding: plain

  "/etc/le/config" :
    mode: "000755"
    owner: root
    group: root
    content: |
      [Main]
      user-key = xxxxxxxxxxxxxxxxxxxxxxxxxx
      pull-server-side-config=False
      v1_metrics = False
      metrics-mem = system
      metrics-token = 
      metrics-disk = sum
      metrics-swap = system
      metrics-space = /
      metrics-vcpu = core
      metrics-net = sum
      metrics-interval = 5s
      metrics-cpu = system

      [app_aws_log]
      path = /var/log/nginx/access.log
      destination = staging/mylog

    encoding: plain

commands:
  01_update_yum:
    command: yum update 
  02_install_logentries:
    command: yum install python-setuptools -y
  02a_install_logentries:
    command: yum install logentries -y
  02b_install_logentries:
    command: yum install logentries-daemon -y
  03_restart_logentries:
    command: service logentries start

我在.elasticbeanstalk目录中的logentriesBeanstalk.config中对此进行编码。

enter image description here

但是它不会在登录条目中创建登台日志集。

Rails项目运行良好,我在eb实例的配置上启用了cloudwatch。

所以我可以在AWS中看到日志,但是我需要将其与日志条目链接。

(我在eb实例中使用的是vpc)

谢谢。

0 个答案:

没有答案