A gaming company operates a real-time multiplayer game server backend on Amazon EC2 instances. The game server software writes high-throughput debug logs to a local directory at `/opt/gameserver/logs/debug.log`. These log files are rotated every 15 minutes by a custom daemon, renaming the active file to `/opt/gameserver/logs/debug.log.<timestamp>` and creating a new empty `/opt/gameserver/logs/debug.log`. The DevOps team deploys the Unified CloudWatch Agent to forward these logs to Amazon CloudWatch Logs. During peak hours, the team notices that log ingestion drops to zero for several minutes after each 15-minute rotation interval, resulting in missing critical troubleshooting data. Which configuration change should the solutions architect make to ensure continuous log collection without data loss?
- Update the CloudWatch agent configuration JSON by changing the `file_path` parameter to `/opt/gameserver/logs/debug.log*` to match the rotated file patterns, allowing the agent to continuously monitor and upload log data from both the active and rotated files.Cevap
- BRetain `/opt/gameserver/logs/debug.log` as the static `file_path` in the CloudWatch agent configuration, and configure the custom rotation daemon to perform an in-place truncation of the log file instead of renaming it.
- CMaintain `/opt/gameserver/logs/debug.log` as the static `file_path` in the CloudWatch agent configuration, and schedule a cron job on the EC2 instances to restart the `amazon-cloudwatch-agent` service every 15 minutes, timed immediately after the log rotation occurs.
- DConfigure the CloudWatch agent to write logs to a local Amazon S3 bucket, then configure an S3 replication rule to send these logs to a central S3 bucket in a logging account, ensuring the replication rule has an IAM role that bypasses the destination bucket policy.