I have an Elastic Beanstalk Environment on AWS where I deploy via Docker container. I've enabled the default logs from the UI Configuration of Beanstalk and we get standard logs such as eb-activity.log in CloudWatch.
My goal is to integrate the custom logfile: logger.log into CloudWatch.
Dockerrun.aws.json looks like this:
{
"AWSEBDockerrunVersion": "1",
"Ports": [
{
"ContainerPort": "3000"
}
],
"Logging": "/path/to/logs"
}
Then in .ebextensions/01_cloudwatch.config I have
files:
/etc/awslogs/config/my_app_log.conf:
content: |
[/var/log/eb-docker/containers/eb-current-app/logger.log]
log_group_name=/aws/elasticbeanstalk/appname/var/log/eb-docker/containers/eb-current-app/logger.log
log_stream_name={instance_id}
file=/var/log/eb-docker/containers/eb-current-app/logger.log
group: root
mode: "000600"
owner: root
The eb-user has full permissions of CloudWatch (CloudWatchFullAccess and CloudWatchLogsFullAccess). Also, I can validate the existence of /var/log/eb-docker/containers/eb-current-app/logger.log.
Still, logs don't appear in CloudWatch. In the same directory there are afc818177506-stdouterr.log files that appear in CloudWatch, they're being configured in /etc/awslogs/config/beanstalklogs.conf. Moreover, I made sure to do sudo service awslogs restart.
Any idea how to debug the problem or do you see any obvious mistake I did so logger.log does not appear in CloudWatch? Many thanks!
PS. I've already looked at the similar questions and have tried a good amount of time to solve the issue without success, so your help is needed.