-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from maxvisser/master
EB config file to stream laravel log to cloudwatch
- Loading branch information
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# The following file installs and configures the AWS CloudWatch Logs agent | ||
# to push the /var/app/current/storage/logs/laravel.log file to a Log Group in CloudWatch Logs. | ||
|
||
# You can then see 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: | ||
# /aws/elasticbeanstalk/<environment name>/<full log name path> | ||
|
||
## For more information about "Log Streaming" feature, see: | ||
## http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.cloudwatchlogs.html | ||
|
||
## This file was templated based on the following example: | ||
## https://github.com/awsdocs/elastic-beanstalk-samples/blob/master/configuration-files/aws-provided/instance-configuration/logs-streamtocloudwatch-linux.config | ||
|
||
# Usually, the option_settings with enabled Stream Logs should be uncommented if you are not using IaaC, like Chef or Terraform. | ||
# If you created the environment manually, uncomment the following lines and set the amount of retention in days. | ||
|
||
# option_settings: | ||
# - namespace: aws:elasticbeanstalk:cloudwatch:logs | ||
# option_name: StreamLogs | ||
# value: true | ||
# - namespace: aws:elasticbeanstalk:cloudwatch:logs | ||
# option_name: DeleteOnTerminate | ||
# value: false | ||
# - namespace: aws:elasticbeanstalk:cloudwatch:logs | ||
# option_name: RetentionInDays | ||
# value: 7 | ||
|
||
packages: | ||
yum: | ||
awslogs: [] | ||
|
||
# To enable the AWS logs configuration, uncomment the following lines. This will configure your EC2 instance | ||
# to install and configure the AWS Cloudwatch Logs agent to stream your storage/logs/laravel.log file. | ||
|
||
# files: | ||
# "/etc/awslogs/awscli.conf" : | ||
# mode: "000600" | ||
# owner: root | ||
# group: root | ||
# content: | | ||
# [plugins] | ||
# cwlogs = cwlogs | ||
# [default] | ||
# region = `{"Ref":"AWS::Region"}` | ||
# | ||
# "/etc/awslogs/awslogs.conf" : | ||
# mode: "000600" | ||
# owner: root | ||
# group: root | ||
# content: | | ||
# [general] | ||
# state_file = /var/lib/awslogs/agent-state | ||
# | ||
# "/etc/awslogs/config/logs.conf" : | ||
# mode: "000600" | ||
# owner: root | ||
# group: root | ||
# content: | | ||
# [/var/app/current/storage/logs] | ||
# datetime_format = %Y-%m-%d %H:%M:%S | ||
# log_group_name = `{"Fn::Join":["/", ["/aws/elasticbeanstalk", { "Ref":"AWSEBEnvironmentName" }, "var/app/current/storage/logs"]]}` | ||
# log_stream_name = {instance_id} | ||
# timestamp_format = '[%Y-%m-%d %H:%M:%S]' | ||
# file = /var/app/current/storage/logs/laravel.log | ||
# buffer_duration = 5000 | ||
# use_gzip_http_content_encoding = true | ||
# multi_line_start_pattern = {datetime_format} | ||
|
||
# commands: | ||
# "01_enable_aws_log_daemon": | ||
# command: systemctl enable awslogsd.service | ||
# "02_restart_aws_log_daemon": | ||
# command: systemctl restart awslogsd |