MySQL error log(PLC)
1. rsyslog conf 설정
vi /etc/rsyslog.d/80-mysql.conf#variables required for non-syslog log file forwarding – mysql error
#edit on your location
input(type=”imfile”
File=”/var/log/mysqld.log”
Tag=”mysqld-errors”
Severity=”error”
Facility=”local7″)
input(type=”imfile”
File=”/var/log/mysql-slow.log”
Tag=”mysql-slow”
Severity=”notice”
Facility=”local7″)
###### Creates a template for each log file in the Logentries UI
### logic to apply the relevant templates to the different log files
if $programname == ‘mysqld-errors’ then /var/log/plura/ceelog-127.0.0.1.log;CEETemplate
:programname, isequal, “mysqld-errors” ~
if $programname == ‘mysql-slow’ then /var/log/plura/ceelog-127.0.0.1.log;CEETemplate
:programname, isequal, “mysql-slow” ~2. MySQL – SLOW QUERY 설정

3. 로그 확인

참고 사이트
Last updated