In daily use of Linux, server logs are often used. Server logs can help us debug server programs, print error logs, see user access logs, and help us locate problems. So, how can we view Linux server logs?

If you are using the Windows operating system, you can use the Linux remote connection client Xshell to connect. The specific steps are as follows:

The specific operation steps are as follows:

1. Double click to open the Xshell terminal emulator. In the main interface window that opens, click the New button in the upper left corner, as shown in the following figure;



Figure 1: Executing a New Session


2. After clicking on "New", as shown in the following figure, you need to establish a remote connection with your own Linux server. In the connection, enter the IP address and hostname of the server you want to connect to;


Figure 2: Connecting to a Linux server


3. Use the cd command to enter the directory where the server log files are stored, such as the log directory here;


Figure 3: Viewing the log file directory


4. Enter the log directory and find the log file that needs to be monitored, such as the production.log file that needs to be monitored;


Figure 4: Searching for log files


5. Use the command: tail - f log/production.log to view the newly added information in the document. This way, you can see your access logs in real time, making it easier to debug the program and view errors.


Figure 5: Viewing Document Information


After the above operations, we can view the logs of the Linux server in Xshell, which improves work efficiency and eliminates the need to view them in Linux.