Manage Pilot logs

更新时间:
复制 MD 格式

This topic describes how to manage Pilot logs, including startup log parameters, log level modification, and log queries.

Pilot startup log parameters

- --log_target=stdout // Log output destination
- --log_rotate=/home/admin/logs/discovery.log  // Log file path
- --log_rotate_max_size=512   // Maximum size for log rotation in KB
- --log_rotate_max_backups=24  // Maximum number of log backups to retain
- --log_as_json=false    // Specifies whether to output logs in JSON format. Set to true for JSON format or false for plain text.

Modify the Pilot log level

~ curl 127.0.0.1/logging
    Usage: curl 'http://127.0.0.1:8080/logging?<scope>=<logLevel>&<scope>=<logLevel>'
    default : info
    model : info
    proxy connection : info
    ads : info
~ curl "127.0.0.1:8080/logging?all=debug"
    set scope ads log level to debug
    set scope default log level to debug
    set scope model log level to debug
    set scope proxy connection log level to debug

Query Pilot logs

// Access the pilot pod.
kubectl -n cloudmesh exec -it pilot-name -c discovery /bin/bash
// View the log information.
tail -10000f /home/admin/logs/discovery.log