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.