@INCLUDE {{{managed.temporaryFiles.fluent_base}}} [SERVICE] # See: # https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html # https://github.com/aws-samples/amazon-ecs-firelens-under-the-hood/tree/master/generated-configs/fluent-bit # Setting Flush interval much higher to avoid throttling: https://github.com/aws/aws-for-fluent-bit/issues/135 Flush 5 Grace 30 HTTP_Server On HTTP_Listen 0.0.0.0 HTTP_PORT 2020 Log_Level info Parsers_File {{{managed.temporaryFiles.parser}}} storage.path {{{managed.temporaryPaths.storage}}} [OUTPUT] # Send any StdOut/StdErr Logs to A CloudWatch Logs Group. # FireLens automatically tags them to {container name}-firelens-{task ID}. Name cloudwatch_logs Match XYZ-Container-${REGION}-${STAGE_CAPITALIZED}-V1-firelens-* region ${LOG_REGION} log_group_name XYZ-${REGION}-${STAGE}-AppContainer-STDOUT-V2 log_stream_prefix STDOUT-${ECS_TASK_ID} auto_create_group true retry_limit 3 [OUTPUT] # Send any Application Logs to A CloudWatch Logs Group Name cloudwatch_logs Match ApplicationLogs region ${LOG_REGION} log_group_name XYZ-${REGION}-${STAGE}-ApplicationLogs log_stream_prefix ${ECS_TASK_ID}/ log_key log auto_create_group true net.keepalive Off retry_limit 3 Alias ApplicationLogsCWL [OUTPUT] # Send Request Logs to S3 - https://docs.fluentbit.io/manual/pipeline/outputs/s3 # Multipart is the default and is recommended Name s3 Match RequestLogs bucket XYZ-${REGION_LOWERCASE}-${STAGE_LOWERCASE}-${ACCOUNT_ID}-request-log-v2 region ${LOG_REGION} s3_key_format /%Y/%m/%d/%H/%M/${ECS_TASK_ID}/$UUID.gz total_file_size 10g compression gzip log_key log use_put_object false preserve_data_ordering true auto_retry_requests true upload_timeout 1m Alias RequestLogsS3