4
votes

I'm running a java application on AWS Elastic Beanstalk (Java 8 running on 64bit Amazon Linux/2.7.4) By default the java application logs to STDOUT and Elastic Beanstalk automatically stores STDOUT in /var/log/web-1.log. This works as expected.

See https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/java-se-procfile.html for more information about how Elastic Beanstalk captures and stores STDOUT.

After the web-1.log file reaches a certain size, it gets rotated to /var/log/rotated/web-1.logXXX.gz. However, once this happens, the original web-1.log file is cleared (expected) and no further log messages are written to the file (not expected). All future log messages appear to go directly to a file in the rotated log directory.

Any ideas what might be causing this? I haven't make any changes to the way Elastic Beanstalk handles log rotation.

1
Experiencing the very same behavior. Any ideas?gyorgyabraham

1 Answers

-1
votes

Elastic Beanstalk instances (at least the ones I'm using) have the logrotate daemon running. Maybe you can configure it by putting a config file in /etc/logrotate.d?

The problem with the empty log might be a stale file handle from when the log is rotated? See this answer for some examples of how to handle that.