View Log Files
During development and debugging, viewing log files is a crucial step. ServBay provides two methods for viewing log files: directly accessing the log directory and through the ServBay GUI interface. Here are the detailed steps.
Method 1: Directly Access the Log Directory
1. Log File Directory
ServBay's log files are stored in the /Applications/ServBay/logs
directory. This directory contains log files for various services including PHP, Caddy, Redis, MariaDB, etc.
2. Access the Log Directory
You can access the log directory via the terminal or a file manager. Here are the steps to access it via the terminal:
- Open the terminal application.
- Enter the following command and press Enter to navigate to the log directory:bash
cd /Applications/ServBay/logs
1
3. View Log Files
In the log directory, you can use the ls
command to list all log files and subdirectories:
ls
You will see a structure similar to the following:
caddy
dnsmasq
mariadb
memcached
php
|____5.6
|____7.0
|____7.1
|____7.2
|____7.3
|____7.4
|____8.0
|____8.1
|____8.2
|____8.3
|____8.4
postgresql
redis
xdebug
|____5.6
|____7.0
|____7.1
|____7.2
|____7.3
|____7.4
|____8.0
|____8.1
|____8.2
|____8.3
|____8.4
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
4. View Specific Log Files
You can use the cat
, less
, or tail
commands to view the contents of specific log files. For example:
View PHP 7.4 Logs
cat php/7.4/php-fpm.log
Or use the less
command for paginated viewing:
less php/7.4/php-fpm.log
Use the tail
command to view the most recent log entries:
tail -f php/7.4/php-fpm.log
View Caddy Logs
Caddy logs are stored in the caddy
directory. You can navigate to this directory to view specific log files:
cd caddy
ls
2
Then use the above commands to view specific log files.
Method 2: Through ServBay's GUI Interface
1. Open ServBay
In the Applications
, find the ServBay icon and double-click to open.
2. View Service Logs
In ServBay's GUI interface, you can view log files through the following steps:
Through the 'Services' Panel
- Open ServBay's GUI interface and go to the 'Services' panel.
- On the right side of each service, you will see a log icon. Click this icon to view the log file for that service.
Through the 'Hosts' Panel
- In ServBay's GUI interface, go to the 'Hosts' panel.
- On the right side of each host, you will see a log icon. Click this icon to view the log file for that host.
3. Analyze Log Files
By viewing log files, you can analyze the system's operational status, error information, and performance metrics. Common log files include:
php/version/php-fpm.log
: Records the operational status and error information of PHP-FPM.caddy
directory: Records access logs and error logs of the Caddy Web server.redis.log
: Records the operational status and error information of the Redis database.mariadb.log
: Records the operational status and error information of the MariaDB database.xdebug/version
directory: Records debug information of XDebug.
4. Clean Up Log Files
Log files can take up a lot of disk space, so it's recommended to periodically clean up log files that are no longer needed. You can use the following command to delete specific log files:
rm php/7.4/php-fpm.log
Note: Please ensure you have backed up important log information before deleting log files.