ray.serve.schema.LoggingConfig#

class ray.serve.schema.LoggingConfig(*, encoding: str | EncodingType = None, log_level: int | str = 'INFO', logs_dir: str | None = None, enable_access_log: bool = True)[source]#

Bases: BaseModel

Logging config schema for configuring serve components logs.

Example

from ray import serve
from ray.serve.schema import LoggingConfig
# Set log level for the deployment.
@serve.deployment(LoggingConfig(log_level="DEBUG"))
class MyDeployment:
    def __call__(self) -> str:
        return "Hello world!"
# Set log directory for the deployment.
@serve.deployment(LoggingConfig(logs_dir="/my_dir"))
class MyDeployment:
    def __call__(self) -> str:
        return "Hello world!"

PublicAPI (alpha): This API is in alpha and may change before becoming stable.

Methods

__init__

Create a new model by parsing and validating input data from keyword arguments.

construct

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.

copy

Duplicate a model, optionally choose which fields to include, exclude and change.

dict

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

json

Generate a JSON representation of the model, include and exclude arguments as per dict().

update_forward_refs

Try to update ForwardRefs on fields based on this Model, globalns and localns.

Attributes

encoding

log_level

logs_dir

enable_access_log