Linux development is often used in the log, this is very useful, can help us quickly locate the error, such as if we do lamp development, the page does not error, but also no debugging tools, we step by step wrong very good time, and this method is also very stupid, so it is very important to master the use of the log.
To view the log commands:
Cat
Tail-f
For example, we may often look at the Apache log, can quickly locate the error of the Web project, Apache log my default directory under Var/log/httpd/, there are two log files Access_log and error_log files, I am accustomed to
Cat Access_log
Cat Error_log
This allows you to view the log file, quickly navigate to the number of error lines, and then parse the error
In addition to these errors, there are some system logs
/var/log/message system startup information and error log, which is one of the most commonly used logs in red Hat Linux
/var/log/secure Security-related log information
/var/log/maillog message-related log information
/var/log/cron log information related to timed tasks
/var/log/spooler log information related to UUCP and news devices
/var/log/boot.log Daemon starts and stops related log messages
These principles are the same, anyway the general running software is a log file, you want to find the log, you can find its location to view, in order to save time can use this command to quickly find
Find/-name file name
Then the corresponding path will be listed.
Of course, you can also use tools or write shell scripts to analyze the log, because the log is generally many, only by our manual analysis of efficiency is very slow, and is very stupid method
View logs under Linux