With the increase of the server, feel the time to look at the log has been more and more, but also a variety of inconvenient, so want to focus on a server to deal with. I forgot it after I was afraid to use it, so I'll make a note.
Because my LNMP environment has been set up very early. So it was used directly.
I also refer to this article to build.
Http://www.cnblogs.com/mchina/p/linux-centos-rsyslog-loganalyzer-mysql-log-server.html
After this article has been built, you may encounter
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/5D/DA/wKioL1Ul5fvyxo9zAACBSJ8ziO4988.jpg "title=" QQ picture 20150409103153.png "alt=" Wkiol1ul5fvyxo9zaacbsj8zio4988.jpg "/>
This is not a log record.
There is no data in systemevents at this time.
View the issue by viewing/var/log/messages. My problem is that MySQL cannot be connected via/var/lib/mysql/mysql.sock.
Because my mysql.sock is placed in/tmp. thus
Ln-s/tmp/mysql.sock/var/lib/mysql/mysql.sock
Restart the next rsyslog to finish. Found no error. Open the Web again, you can also see the log.
Now I want to add some non-syslog. such as Nginx+app+mysql's log.
Rsyslog the central server without the tube, as good as before, the client needs to change under.
#nginx log$ModLoad imfile #不加这个会报错. $InputFileName /usr/local/nginx/logs/error.log #文件需要真实存在 $InputFileTag nginx-errorlog: #读取文件定义下标签, the same host cannot have 2 $inputfilestatefile nginx-errorlog $InputRunFileMonitor #表示开始监控 $ Inputfilename /usr/local/nginx/logs/access.log$inputfiletag nginx-accesslog: $InputFileStateFile nginx-accesslog$InputRunFileMonitor$InputFilePollInterval 10 #等待10秒钟发送一次if $programname == ' Nginx-errorlog ' then @192.168.0.12:514 #匹配就远程传输数据到192 .168.0.12if $programname == ' Nginx-errorlog ' then ~if $programname == ' nginx-accesSlog ' then @192.168.0.12:514if $programname == ' Nginx-accesslog ' then ~
The same format as other documents. MySQL or app logs.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/5D/DA/wKioL1Ul7UHQJS_EAAGpwVP62Fk302.jpg "title=" QQ picture 20150409110300.png "alt=" Wkiol1ul7uhqjs_eaagpwvp62fk302.jpg "/>
This is the other log I added. If the log file does not have data, it will not be displayed.
This loganalyer shows that the nginx effect does not feel very good.
This article is from the "on the Road to Learning" blog, be sure to keep this source http://jonyisme.blog.51cto.com/3690784/1630338
Rsyslog+loganalyze+mysql Log Centralized Processing