SERVER_VERBOSITY
environment variable.
The SERVER_VERBOSITY
variable accepts the following values: DEBUG
, INFO
, WARNING
, ERROR
and CRITICAL
.
SERVER_LOGGING_FORMAT
environment variable. By default it is set as
SERVER_LOGGING_FORMAT=plaintext
. If it is set to unknown format it will use default value instead.
SERVER_LOGGING_FORMAT=plaintext
environment variable.
By default, the server will log messages in the following format:
SERVER_LOGGING_TEMPLATE
environment variable.
Example:
\t
, \n
, etc. can’t be passed through .env
file as they are getting
escaped.To pass such string you canexport SERVER_LOGGING_TEMPLATE=$'%(asctime)s\t[%(name)25.25s]\t%(levelname)5s: %(message)s'
syntax for local
python deployment or docker compose with exported env variables.env
file and -e
flag for plain docker deployment
docker run -d --env-file .env -e SERVER_LOGGING_TEMPLATE=$'%(asctime)s\t\t[%(name)25.25s]\t%(levelname)5s: %(message)s' mageai/mageai:latest
SERVER_LOGGING_FORMAT=json
.
JSON formatted logs will have the following fields:
<path_to_project>/pipelines/<pipeline_name>/.logs
folder.
Learn more about logs here.
INFO
. To customize the logging level for logs of block runs and pipeline runs,
you can set the level
of logging_config
in your project’s metadata.yaml
file.
Example logging config to only log errors:
retention_period
in the logging_config
. Valid period units
are ‘h’, ‘d’, and ‘w’.
Example logging config:
mage clean-old-logs [project_path]
to clean up old logs
kwargs.get('logger')
within the block.
Example:
logging
config in your project’s metadata.yaml
file.
Example S3 logging config:
logging_config
.AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
.endpoint_url
can be configured to connect to S3 compatible services (e.g. MinIO).
logging
config in your project’s metadata.yaml
file.
Example GCS logging config:
/pipelines/[uuid]/edit
), you can execute the code for an
individual block and see the output. Any print
statements in the block of code is displayed
in the block’s output.
However, you can redirect those print
statements to output to logs.
To toggle this feature, go to the pipeline settings page (e.g. /pipelines/[uuid]/settings
)
and check the box labeled
When running a block while editing a pipeline, output the block messages to the logs.