Courseiva

SAP-C02 Continuous Improvement for Existing Solutions Practice Question

A company has a legacy application that runs on a single EC2 instance. The application writes logs to a local file. The company wants to centralize log management without modifying the application code. Which solution is MOST operationally efficient?

⚠ Common exam trap

A common mix-up: candidates think modifying the application to use stdout with the awslogs driver is simpler, but that requires code changes, which the question explicitly prohibits.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Install and configure the Amazon CloudWatch agent on the EC2 instance.

The Amazon CloudWatch agent can be installed on the EC2 instance without modifying application code. It reads the local log file and sends the logs to Amazon CloudWatch Logs for centralized management, making it the most operationally efficient solution.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Use AWS CloudTrail to capture log file changes.

    Why it's wrong here

    CloudTrail records AWS API activity, not application log file contents, so it captures nothing from the local file. It is tempting because it is a managed, agentless audit service, but it is designed for API call auditing, whereas the CloudWatch agent tails and ships the application's log file.

  • ✗

    Modify the application to write logs to stdout and use the awslogs driver.

    Why it's wrong here

    Writing to stdout requires modifying the application, which the stem explicitly forbids. It is tempting because the awslogs driver is the standard container logging path, but it only applies to containers and demands code changes, whereas the CloudWatch agent reads the existing file unmodified.

  • ✓

    Install and configure the Amazon CloudWatch agent on the EC2 instance.

    Why this is correct

    Installing the CloudWatch agent lets it tail the existing local log file and stream entries to CloudWatch Logs, so centralised management is achieved with zero application changes — satisfying the no-code-modification constraint. This is more operationally efficient than custom forwarding scripts, since the agent handles rotation, buffering and delivery natively.

  • ✗

    Set up an Amazon S3 bucket and use an AWS Lambda function to periodically copy log files.

    Why it's wrong here

    Periodic Lambda copying introduces polling latency and duplicates files rather than streaming them, and requires custom code to manage. It is tempting as a serverless, code-free-on-the-instance approach, but the CloudWatch agent tails the file continuously and ships it without application changes or polling.

About these practice questions

Courseiva writes every SAP-C02 question from scratch — 984 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SAP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SAP-C02 exam.