一,在service檔案中,指定日誌的level
編輯service檔案
[Unit]
Description=Alert Manager
wants=network-online.target
After=network-online.target
[Service]
Type=simple
User=prometheus
Group=prometheus
Restart=always
ExecStart=/opt/alertmanager-0.27.0.linux-amd64/alertmanager --config.file=/opt/alertmanager-0.27.0.linux-amd64/alertmanager.yml --storage.path=/opt/alertmanager-0.27.0.linux-amd64/data/ --log.level=debug
[Install]
WantedBy=multi-user.target
然後重新載入service檔案:
# systemctl daemon-reload
二,檢視日誌:
用journalctl 檢視日誌
journalctl -u alertmanager.service