3

In my terraform deployment I have settings

  setting {
    namespace = "aws:elasticbeanstalk:container:tomcat:jvmoptions"
    name = "Xms"
    value = "2048m"
  }

  setting {
    namespace = "aws:elasticbeanstalk:container:tomcat:jvmoptions"
    name = "Xmx"
    value = "2048m"
  }

  setting {
    namespace = "aws:elasticbeanstalk:container:tomcat:jvmoptions"
    name = "JVM Options"
    value = "-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintTenuringDistribution -Xloggc:log/gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=100M"
  }

In the container options, I can see that the Xms, Xmx and GC settings were applied. But when I download full logs from the container I can not find GC logs anywhere. What could be an issue? I read the answer with the common GC setup, but it does not work in my case. I use Tomcat 8.5 with Java 8 running on 64bit Amazon Linux/3.1.0

enter image description here

theodor
  • 1,371
  • 1
  • 14
  • 32
  • Please provide the full `Dockerrun.aws.json`, second, did you define the awslogs as log driver that the logs can be only view in `cloudwatch`? thrid, the logs something saved in container or ec2 instances some where, did you login the ec2 instances and search them out? – BMW Feb 11 '19 at 05:44

1 Answers1

1

the issue you are facing is permission. You are starting the service under tomcat user so it has no access to that path to create logs.

Try out this -Xloggc:/var/log/tomcat8/gc.log

Vadim Ivanov
  • 593
  • 1
  • 6
  • 16