Skip to content

Commit

Permalink
Merge pull request #120 from DwayneJengSage/develop
Browse files Browse the repository at this point in the history
BRIDGE-3174 Update Exporter to Corretto
  • Loading branch information
DwayneJengSage authored Feb 11, 2022
2 parents 2fd74e9 + 3b75794 commit cc2d7ec
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions ebextensions/tomcatlogs.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#### the Log Stream name as the instance id. The following files are examples of logs that will be
#### streamed to CloudWatch Logs in near real time:
####
#### /var/log/tomcat8/catalina.out
#### /var/log/tomcat/catalina.out
####
#### You can then access the CloudWatch Logs by accessing the AWS CloudWatch Console and clicking
#### the "Logs" link on the left. The Log Group name will follow this format:
Expand All @@ -14,6 +14,10 @@
#### http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.cloudwatchlogs.html
###################################################################################################

packages:
yum:
awslogs: []

files:
"/etc/awslogs/config/tomcatlogs.conf" :
mode: "000644"
Expand All @@ -23,9 +27,32 @@ files:
[/var/log/tomcat8/catalina.out]
log_group_name=`{"Fn::Join":["/", ["/aws/elasticbeanstalk", { "Ref":"AWSEBEnvironmentName" }, "var/log/tomcat8/catalina.out"]]}`
log_stream_name={instance_id}
file=/var/log/tomcat8/catalina.out*
file=/var/log/tomcat/catalina.out*

"/etc/rsyslog.d/catalina.conf":
mode: "0644"
owner: root
group: root
content: |
#redirect tomcat logs to /var/log/tomcat/catalina.out discarding timestamps since the messages already have them
template(name="catalinalog" type="string"
string="%msg%\n")
if $programname == 'server' then {
*.=warning;*.=err;*.=crit;*.=alert;*.=emerg /var/log/tomcat/catalina.out;catalinalog
*.=info;*.=notice /var/log/tomcat/catalina.out;catalinalog
}

commands:
"01_restart_awslogs":
command: service awslogs restart
"02a_systemctl_start_awslogsd":
command: systemctl start awslogsd
ignoreErrors: true

"02b_systemctl_enable_awslogsd_service":
command: systemctl enable awslogsd.service
ignoreErrors: true

"02c_restart_awslogs":
command: service awslogsd restart

"03_restart_rsyslog":
command: systemctl restart rsyslog

0 comments on commit cc2d7ec

Please sign in to comment.