check.logFile, this AnQiCMS built-in "heartbeat monitor" is used to quickly diagnose system status.
check.log: The "health record" of AnQiCMS process.
In the deployment of AnQiCMS, we usually make use ofstart.shandstop.shThis watchdog script is used to manage the lifecycle of the main program. These scripts do not just start or stop AnQiCMS; they also perform a routine check on the running status of the AnQiCMS core process and record the check results in the form of timestamps.check.logthe file.
check.logThe file is actually the snapshot of the current state of the AnQiCMS process when these management scripts are executed.Snapshot recordIt records the system's answer to the question of whether the AnQiCMS process is running every time the startup script or stop script is triggered. This makescheck.logIt became the first-hand information for us to judge whether AnQiCMS is running healthily.
How to viewcheck.logFile
check.logFiles are usually located in the root directory of your AnQiCMS installation, withanqicmsand the executable filestart.sh/stop.shThe script is at the same level.
To view the content of this file, you can log in to the server and access it through the command line tool. Here are two common ways to view it:
One method is to usetailUse the command to view in real timecheck.logThe latest content of the file. This is very useful for observing the dynamic changes of the AnQiCMS process. For example:
tail -f /www/wwwroot/anqicms/check.log
Here/www/wwwroot/anqicms/Please replace it with the actual installation path of AnQiCMS.After executing this command, you will see several lines at the end of the log file, and they will be displayed on the screen immediately when new log records are generated.
Another method is to usecatcommand to view the entire content of the file, usually combinedgreporlessfor filtering or pagination to make reading easier. For example, to view all records:
cat /www/wwwroot/anqicms/check.log
Or if you only want to view the most recent records, you can use:
tail -n 20 /www/wwwroot/anqicms/check.log
This command will displaycheck.logThe last 20 lines of the file.
Interpretcheck.logLog content, judge process status
check.logEach log line has a similar structure, usually containing a timestamp, process name (default asanqicms), and the most important "PID check" result.
When you viewcheck.logWhen dealing with files, pay attention to the following situations to judge the running status of the AnQiCMS process:
1. The process is running normally
Ifcheck.logRegularly appear logs in the following format, andPID check:The number following is1(When starting the scriptstart.shwhen checking the process count), or it is a specific process ID (when stopping the scriptstop.shWhen trying to get PID), it usually means that the AnQiCMS core process is active during script checking.
20231027 10:30:01 anqicms PID check: 1
20231027 10:31:01 anqicms PID check: 1
...
Or, if it is to stop script getting PID:
20231027 10:45:01 anqicms PID check: 12345
This indicates that the AnQiCMS process is present when the script is executed. In most cases, as long ascheck.logThe system continuously displays these records, and your website is accessing normally, which means AnQiCMS is running stably.
2. The process has stopped or tried to start.
If you manually stop AnQiCMS or the system exits the AnQiCMS process unexpectedly due to some reason, ifstart.shThe script (usually configured in a scheduled task) is triggered, you may see the following types of records incheck.logthe following types of records:
20231027 10:40:01 anqicms PID check: 0
20231027 10:40:01 anqicms NOT running
Immediately thereafter, if the startup is successful,start.shThe system will try to restart AnQiCMS. At this time, althoughcheck.logit will not directly display "Startup successful", but it will stop recordingPID check: 0And will recover the record `PID check: