Viewing Log Files
In the process of development and debugging, checking log files is a crucial step. ServBay offers two methods for viewing log files: directly accessing the log directory and using ServBay's GUI interface. The detailed steps are as follows.
Method 1: Directly Accessing Log Directory
1. Log File Directory
ServBay's log files are stored in the /Applications/ServBay/logs
directory. This directory contains logs for various services, including PHP, Caddy, Redis, MariaDB, MySQL, MongoDB, etc.
2. Accessing the Log Directory
You can access the log directory via the terminal or a file manager. Here are the steps to access the log directory through 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. Viewing 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
mongodb
mysql
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
31
32
4. Viewing Specific Log Files
You can use cat
, less
, or tail
commands to view specific log file contents. For example:
Viewing 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 latest log entries:
tail -f php/7.4/php-fpm.log
Viewing 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 commands above to view specific log files.
Method 2: Using ServBay's GUI Interface
1. Open ServBay
Find the ServBay icon in Applications
and double-click to open it.
2. Viewing Service Logs
In ServBay's GUI interface, you can view log files through the following steps:
Via 'Quick Service Management' Panel
- Enter the dashboard in ServBay's GUI interface.
- On the right side of each service, you will see a log icon. Click this icon to view the log files for that service.
Via 'Services' Panel
- Open the ServBay GUI interface and enter the 'Services' panel.
- On the right side of each service, you will see a log icon. Click this icon to view the log files for that service.
Via 'Host' Panel
- Enter the 'Host' panel in ServBay's GUI interface.
- On the right side of each host, you will see a log icon. Click this icon to view the log files for that host.
Via 'Service Configuration' Panel
- In ServBay's GUI interface, enter the 'Service Configuration' panel.
- In the upper right corner of each service, you will see a log icon. Click this icon to view the log files for that service.
3. Analyzing Log Files
By viewing log files, you can analyze system operation status, error messages, and performance metrics. Common log files include:
php/version-number/php-fpm.log
: records the operational status and error messages of PHP-FPM.caddy
directory: logs access and error logs for the Caddy Web server.redis.log
: logs the operating status and error messages of the Redis database.mariadb.log
: logs the operating status and error messages of the MariaDB database.mysql.log
: logs the operating status and error messages of the MySQL database.mongodb.log
: logs the operating status and error messages of the MongoDB database.xdebug/version-number
directory: records debugging information for XDebug.mailpit.log
: logs the operating status and error messages of the Mailpit email service.
4. Cleaning Log Files
Log files can take up significant disk space, so it's advisable to periodically clean up unnecessary log files. You can use the following command to delete specific log files:
rm php/7.4/php-fpm.log
Note: Before deleting log files, make sure to back up important log information.