故障排除
日志级别是按模块控制的,默认情况下,除错误外,所有日志记录都被禁用。日志记录通过 RUST_LOG 环境变量控制。此环境变量的值是以逗号分隔的日志记录指令列表。
这将为所有模块启用调试日志记录:
export RUST_LOG=debug
martin postgres://postgres@localhost/db
而这只会为 actix_web 模块启用详细日志记录,并为 martin 和 tokio_postgres 模块启用调试日志记录:
export RUST_LOG=actix_web=info,martin=debug,tokio_postgres=debug
martin postgres://postgres@localhost/db