代理有两个日志文件。
mysql-monitor-agent.log
是一般日志,mysql-monitor-agent-full.log
也是包含对支持团队有用的堆栈跟踪的完整日志。
代理日志文件的默认路径如下:
视窗路径:
C:\Program Files\MySQL\Enterprise\Agent\logs\
Linux 路径:
/opt/mysql/enterprise/agent/logs/
macOS 路径:
/Applications/mysql/enterprise/agent/logs/
日志文件使用 log4j 管理,它使用
log4j2.xml
. 代理每 30 秒监视一次更改,并相应地更新 MySQL Enterprise Monitor。默认文件位置:
视窗路径:
C:\Program Files\MySQL\Enterprise\Agent\etc\log4j2.xml
Linux 路径:
/opt/mysql/enterprise/agent/etc/log4j2.xml
macOS 路径:
/Applications/mysql/enterprise/agent/etc/log4j2.xml
日志文件的最大大小可能限制为 2GB。如果 MySQL Enterprise Monitor Agent 无法将信息添加到配置的日志文件,则会将信息发送到标准输出。
由于日志文件可能会变大,您可以通过定义 log4j 选项来轮换日志。例如,要实现 10 x 10MB 日志文件的循环:
<Policies>
<SizeBasedTriggeringPolicy size="10 MB">
</Policies>
<DefaultRolloverStrategy max="10"/>
有关 log4j 的其他信息,请阅读位于http://logging.apache.org/log4j/的 log4j 文档。