Moe
09/27/2024, 2:08 PMMarvin
09/27/2024, 2:08 PMlogs:CreateLogStream
, logs:CreateLogGroup
, and logs:PutLogEvents
. You can find more details and available options in the AWS documentation here. This feature is not enabled by default unless you explicitly set stream_output
. For additional options, you can pass configuration details using cloudwatch_logs_options
.
For Prefect 3.x, in terms of logging configuration, Prefect provides settings to customize the logging level and individual loggers. By default, logs are directed to the console, but you can override this by specifying environment variables or Prefect Profile settings. You can also configure out-of-box logging by providing your own logging.yml
file in your PREFECT_HOME
directory, which by default is ~/.prefect
.
- For Prefect 2.x documentation: AWS ECS with Prefect
- For Prefect 3.x documentation: Logging Configuration in Prefect
These settings and configurations ensure your logs are appropriately managed, whether directed to AWS CloudWatch or customized to a specific directory or logging format.Moe
09/27/2024, 2:21 PMMarvin
09/27/2024, 2:22 PMawslogs-group
configuration. This is how you determine the name of the CloudWatch log group.
For Prefect 2.x, the relevant parameters you would configure in your task definition are as follows:
python
cloudwatch_logs_options: Dict[str, str] = Field(
default_factory=dict,
description=(
"When `configure_cloudwatch_logs` is enabled, this setting may be used to "
"pass additional options to the CloudWatch logs configuration or override "
"the default options. See the AWS documentation for available options. "
"<https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html#create_awslogs_logdriver_options.>"
)
)
For Prefect 3.x, you can customize logging using environment variables or Prefect Profile settings. For example:
- To change the logging level: PREFECT_LOGGING_LEVEL="DEBUG"
- To specify a different log group: Override the awslogs-group
option in your ECS task definition.
For more detailed instructions:
- Prefect 2.x ECS Integration
- Prefect 3.x Logging Configuration
These resources will help you configure the logging group that fits your needs.