US>On Linux servers, you are running services such as nginx, php-fpm, and mysqld.
Is there any software that makes it easy to view log files for these services?
Currently, whenever there is a problem, I check it by typing a command like sudo tail-f/var/log/nginx/error.log
, which makes me feel very inefficient.
They want to find an error, so tail-f
will cause it to hang out, so I think it will be difficult.There are a lot of commercial apps, but ELK stacks (Elasticsearch, Logstash, Kibana) are popular for free and open source.You can easily collect logs, set error detection conditions, and draw graphs.
Each role is
Installation instructions are here.
As an application, Logstash calculates the hash of the stack trace string when an error occurs and stores it as an ID.If you count the frequency of occurrence of the same ID, you can fix the bug fix for frequent errors first, or you can fix it from rare items to prevent it from becoming a big problem.
tail-f
so I will answer with the assumption that I want to see real-time logs.
There's not much other software to do this.Normally, it's up to the time of display (equivalent to tail
without cat
or -f
), but commercial server management software like Plesk or HDE controller might do it.
If sudotail-f/var/log/nginx/error.log
is hard to type, why don't you set alias to .bashrc?
alias tf = 'sudotail-f'
If you write tf/var/log/...
you can run sudo tail-f/var/log/...
.You can use alias to include the file name.
Also, create a dedicated user to review logs and place it in .bashrc
sudotail-f...
You may want to write .After logging in, the log appears without permission.
As others have said, if you show us how you feel convenient, we will be able to give you a more specific answer.
For example, if it is inconvenient to distribute log files, nginx, php-fpm, and mysqld all support syslog output, so if you set up a syslog server and focus on it, you can only check the logs in one place.You can also monitor log files with monitoring software such as Zabbix if you want to raise an alert such as email when a specific string is printed in the log.
582 PHP ssh2_scp_send fails to send files as intended
916 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
619 Uncaught (inpromise) Error on Electron: An object could not be cloned
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.