3

I'm using Amazon Beanstalk for my Symfony2.1 app (using Linux AMI with Apache) and I activated Log file rotation to Amazon S3. All is working properly, but I ant to know if there are any way to add other logs (that are in other locations) to the rotation system!

Thanks in advance!

Fernando P. G.
  • 191
  • 2
  • 15

2 Answers2

4

You could do something like this.

files:
  "/opt/elasticbeanstalk/tasks/systemtaillogs.d/webapp.conf":
    mode: "000755"
    owner: root
    group: root
    content: |
      /var/app/support/logs/*.log
      /var/log/httpd/error_log
      /var/log/httpd/access_log
      /var/log/messages
      /var/app/current/code-igniter/application/logs/*log

  "/opt/elasticbeanstalk/tasks/publishlogs.d/webapp.conf":
    mode: "000755"
    owner: root
    group: root
    content: |
      /var/app/support/logs/*.log.*
      /var/app/support/logs/*.gz
      /var/log/httpd/*.gz
      /var/app/current/code-igniter/application/logs/*log
Ker Ruben Ramos
  • 642
  • 5
  • 13
  • Did you try this? I just tried doing something similar to get logs from a sidekiq daemon that I have started up along with a rails environment in tomcat. Doesn't seem to be working. Still trying to figure out why...perhaps no permission to write to those directories??? – stuckj Nov 22 '13 at 18:04
0

You could also do the other way around and tell your app to log stuff to the /var/app/support/logs directory. AWS EB will automatically collect those logs and store them in S3 alongside with the other logs.

Note that a EB_CONFIG_APP_LOGS environment variable is available and pointing to the right folder.

What we did in one of our Symfony 2 application is that we mapped the kernel.logs_dir to a SYMFONY_KERNEL_LOGS_DIR environment variable which takes $EB_CONFIG_APP_LOGS as its value.

Benjamin
  • 382
  • 4
  • 12