I am new to AWS elastic beanstalk and trying to stream my application log file to Cloudwatch logs using configuration file (.ebextensions.)
I'm reusing the same configuration code provided here
I have placed the mycustom.conf
in .ebextensions folder and placed this folder in ROOT of my .war file.
I validated the YAML code using online validator (http://www.yamllint.com/) and no issues were reported.
I haven't seen any error in either eb-activity-log or eb-publish-logs.
I also tried doing ssh to my instance and I couldn't find the file mycustom.conf
created in /etc/awslogs/config/
. Is there anything that am missing ?
Adding mycustom.conf
below:
Please help!!
files:
"/etc/awslogs/config/mycustom.conf" :
mode: "000600"
owner: root
group: root
content: |
[/var/log/tomcat8/myapp.log]
log_group_name = `{"Fn::Join":["/", ["/aws/elasticbeanstalk", { "Fn::Select" : [ "1", { "Fn::Split" : [ "-", { "Ref":"AWSEBEnvironmentName" } ] } ] }, "var/log/tomcat8/myapp.log"]]}`
log_stream_name = `{"Fn::Join":["--", [{ "Ref":"AWSEBEnvironmentName" }, "{instance_id}"]]}`
file = /var/log/tomcat8/myapp.log*