/etc/rsyslog.d/30-custom-logs.conf-Tôi đã sử dụng hai địa điểm trong trường hợp có bất kỳ vấn đề về quyền nào
(Php 4, Php 5, Php 7, Php 8)
Syslog - Tạo thông báo nhật ký hệ thống — Generate a system log message
Sự mô tả
Syslog (int local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log
2, chuỗi local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log
3): bool(int local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log
2, string local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log
3): bool
Để biết thông tin về việc thiết lập trình xử lý nhật ký do người dùng xác định, hãy xem syslog.conf (5) Trang hướng dẫn sử dụng UNIX. Thông tin thêm về các cơ sở và tùy chọn Syslog có thể được tìm thấy trong các trang người đàn ông cho Syslog (3) trên các máy Unix.syslog.conf (5)
Unix manual page. More information on the syslog facilities and option can be found in the man pages for syslog (3) on Unix machines.
Thông số
local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log
4
local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log
4 là sự kết hợp của cơ sở và cấp độ. Các giá trị có thể là:
Ưu tiên Syslog () (theo thứ tự giảm dần) Priorities (in descending order)Không thay đổi | Sự mô tả |
---|
local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log 6
| Syslog (int local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log 2, chuỗi local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log 3): bool |
local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log 7
| Để biết thông tin về việc thiết lập trình xử lý nhật ký do người dùng xác định, hãy xem syslog.conf (5) Trang hướng dẫn sử dụng UNIX. Thông tin thêm về các cơ sở và tùy chọn Syslog có thể được tìm thấy trong các trang người đàn ông cho Syslog (3) trên các máy Unix. |
local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log 8
| Thông số |
local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log 9
| local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log 4 |
[alexus@j ~]$ pkg info php56
php56-5.6.12
Name : php56
Version : 5.6.12
Installed on : Thu Aug 20 08:57:22 EDT 2015
Origin : lang/php56
Architecture : freebsd:9:x86:64
Prefix : /usr/local
Categories : www lang devel
Licenses : PHP301
Maintainer :
WWW : http://www.php.net/
Comment : PHP Scripting Language
Options :
CGI : on
CLI : on
DEBUG : off
DTRACE : off
EMBED : off
FPM : on
IPV6 : on
LINKTHR : on
MAILHEAD : off
PHPDBG : off
ZTS : off
Shared Libs required:
libxml2.so.2
libpcre.so.1
libiconv.so.2
Annotations :
cpe : cpe:2.3:a:php:php:5.6.12:::::freebsd9:x64
repo_type : binary
repository : FreeBSD
Flat size : 16.8MiB
Description :
PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open
Source general-purpose scripting language that is especially suited for
Web development and can be embedded into HTML. Its syntax draws upon C,
Java, and Perl, and is easy to learn. The main goal of the language is to
allow web developers to write dynamically generated webpages quickly, but
you can do much more with PHP.
WWW: http://www.php.net/
[alexus@j ~]$
0
| local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log 4 là sự kết hợp của cơ sở và cấp độ. Các giá trị có thể là: |
[alexus@j ~]$ pkg info php56
php56-5.6.12
Name : php56
Version : 5.6.12
Installed on : Thu Aug 20 08:57:22 EDT 2015
Origin : lang/php56
Architecture : freebsd:9:x86:64
Prefix : /usr/local
Categories : www lang devel
Licenses : PHP301
Maintainer :
WWW : http://www.php.net/
Comment : PHP Scripting Language
Options :
CGI : on
CLI : on
DEBUG : off
DTRACE : off
EMBED : off
FPM : on
IPV6 : on
LINKTHR : on
MAILHEAD : off
PHPDBG : off
ZTS : off
Shared Libs required:
libxml2.so.2
libpcre.so.1
libiconv.so.2
Annotations :
cpe : cpe:2.3:a:php:php:5.6.12:::::freebsd9:x64
repo_type : binary
repository : FreeBSD
Flat size : 16.8MiB
Description :
PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open
Source general-purpose scripting language that is especially suited for
Web development and can be embedded into HTML. Its syntax draws upon C,
Java, and Perl, and is easy to learn. The main goal of the language is to
allow web developers to write dynamically generated webpages quickly, but
you can do much more with PHP.
WWW: http://www.php.net/
[alexus@j ~]$
1
| Ưu tiên Syslog () (theo thứ tự giảm dần) |
[alexus@j ~]$ pkg info php56
php56-5.6.12
Name : php56
Version : 5.6.12
Installed on : Thu Aug 20 08:57:22 EDT 2015
Origin : lang/php56
Architecture : freebsd:9:x86:64
Prefix : /usr/local
Categories : www lang devel
Licenses : PHP301
Maintainer :
WWW : http://www.php.net/
Comment : PHP Scripting Language
Options :
CGI : on
CLI : on
DEBUG : off
DTRACE : off
EMBED : off
FPM : on
IPV6 : on
LINKTHR : on
MAILHEAD : off
PHPDBG : off
ZTS : off
Shared Libs required:
libxml2.so.2
libpcre.so.1
libiconv.so.2
Annotations :
cpe : cpe:2.3:a:php:php:5.6.12:::::freebsd9:x64
repo_type : binary
repository : FreeBSD
Flat size : 16.8MiB
Description :
PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open
Source general-purpose scripting language that is especially suited for
Web development and can be embedded into HTML. Its syntax draws upon C,
Java, and Perl, and is easy to learn. The main goal of the language is to
allow web developers to write dynamically generated webpages quickly, but
you can do much more with PHP.
WWW: http://www.php.net/
[alexus@j ~]$
2
| Không thay đổi |
[alexus@j ~]$ pkg info php56
php56-5.6.12
Name : php56
Version : 5.6.12
Installed on : Thu Aug 20 08:57:22 EDT 2015
Origin : lang/php56
Architecture : freebsd:9:x86:64
Prefix : /usr/local
Categories : www lang devel
Licenses : PHP301
Maintainer :
WWW : http://www.php.net/
Comment : PHP Scripting Language
Options :
CGI : on
CLI : on
DEBUG : off
DTRACE : off
EMBED : off
FPM : on
IPV6 : on
LINKTHR : on
MAILHEAD : off
PHPDBG : off
ZTS : off
Shared Libs required:
libxml2.so.2
libpcre.so.1
libiconv.so.2
Annotations :
cpe : cpe:2.3:a:php:php:5.6.12:::::freebsd9:x64
repo_type : binary
repository : FreeBSD
Flat size : 16.8MiB
Description :
PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open
Source general-purpose scripting language that is especially suited for
Web development and can be embedded into HTML. Its syntax draws upon C,
Java, and Perl, and is easy to learn. The main goal of the language is to
allow web developers to write dynamically generated webpages quickly, but
you can do much more with PHP.
WWW: http://www.php.net/
[alexus@j ~]$
3
| Hệ thống là không thể sử dụng |
hành động phải được thực hiện ngay lập tứcđiều kiện quan trọng
điều kiện lỗi
điều kiện cảnh báo[alexus@j ~]$ pkg info php56
php56-5.6.12
Name : php56
Version : 5.6.12
Installed on : Thu Aug 20 08:57:22 EDT 2015
Origin : lang/php56
Architecture : freebsd:9:x86:64
Prefix : /usr/local
Categories : www lang devel
Licenses : PHP301
Maintainer :
WWW : http://www.php.net/
Comment : PHP Scripting Language
Options :
CGI : on
CLI : on
DEBUG : off
DTRACE : off
EMBED : off
FPM : on
IPV6 : on
LINKTHR : on
MAILHEAD : off
PHPDBG : off
ZTS : off
Shared Libs required:
libxml2.so.2
libpcre.so.1
libiconv.so.2
Annotations :
cpe : cpe:2.3:a:php:php:5.6.12:::::freebsd9:x64
repo_type : binary
repository : FreeBSD
Flat size : 16.8MiB
Description :
PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open
Source general-purpose scripting language that is especially suited for
Web development and can be embedded into HTML. Its syntax draws upon C,
Java, and Perl, and is easy to learn. The main goal of the language is to
allow web developers to write dynamically generated webpages quickly, but
you can do much more with PHP.
WWW: http://www.php.net/
[alexus@j ~]$
5 on success or [alexus@j ~]$ pkg info php56
php56-5.6.12
Name : php56
Version : 5.6.12
Installed on : Thu Aug 20 08:57:22 EDT 2015
Origin : lang/php56
Architecture : freebsd:9:x86:64
Prefix : /usr/local
Categories : www lang devel
Licenses : PHP301
Maintainer :
WWW : http://www.php.net/
Comment : PHP Scripting Language
Options :
CGI : on
CLI : on
DEBUG : off
DTRACE : off
EMBED : off
FPM : on
IPV6 : on
LINKTHR : on
MAILHEAD : off
PHPDBG : off
ZTS : off
Shared Libs required:
libxml2.so.2
libpcre.so.1
libiconv.so.2
Annotations :
cpe : cpe:2.3:a:php:php:5.6.12:::::freebsd9:x64
repo_type : binary
repository : FreeBSD
Flat size : 16.8MiB
Description :
PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open
Source general-purpose scripting language that is especially suited for
Web development and can be embedded into HTML. Its syntax draws upon C,
Java, and Perl, and is easy to learn. The main goal of the language is to
allow web developers to write dynamically generated webpages quickly, but
you can do much more with PHP.
WWW: http://www.php.net/
[alexus@j ~]$
6 on failure.
điều kiện bình thường, nhưng có ý nghĩa
Tin nhắn thông tinsyslog()
[alexus@j ~]$ pkg info php56
php56-5.6.12
Name : php56
Version : 5.6.12
Installed on : Thu Aug 20 08:57:22 EDT 2015
Origin : lang/php56
Architecture : freebsd:9:x86:64
Prefix : /usr/local
Categories : www lang devel
Licenses : PHP301
Maintainer :
WWW : http://www.php.net/
Comment : PHP Scripting Language
Options :
CGI : on
CLI : on
DEBUG : off
DTRACE : off
EMBED : off
FPM : on
IPV6 : on
LINKTHR : on
MAILHEAD : off
PHPDBG : off
ZTS : off
Shared Libs required:
libxml2.so.2
libpcre.so.1
libiconv.so.2
Annotations :
cpe : cpe:2.3:a:php:php:5.6.12:::::freebsd9:x64
repo_type : binary
repository : FreeBSD
Flat size : 16.8MiB
Description :
PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open
Source general-purpose scripting language that is especially suited for
Web development and can be embedded into HTML. Its syntax draws upon C,
Java, and Perl, and is easy to learn. The main goal of the language is to
allow web developers to write dynamically generated webpages quickly, but
you can do much more with PHP.
WWW: http://www.php.net/
[alexus@j ~]$
7thông điệp trình gỡ lỗi
[alexus@j ~]$ pkg info php56
php56-5.6.12
Name : php56
Version : 5.6.12
Installed on : Thu Aug 20 08:57:22 EDT 2015
Origin : lang/php56
Architecture : freebsd:9:x86:64
Prefix : /usr/local
Categories : www lang devel
Licenses : PHP301
Maintainer :
WWW : http://www.php.net/
Comment : PHP Scripting Language
Options :
CGI : on
CLI : on
DEBUG : off
DTRACE : off
EMBED : off
FPM : on
IPV6 : on
LINKTHR : on
MAILHEAD : off
PHPDBG : off
ZTS : off
Shared Libs required:
libxml2.so.2
libpcre.so.1
libiconv.so.2
Annotations :
cpe : cpe:2.3:a:php:php:5.6.12:::::freebsd9:x64
repo_type : binary
repository : FreeBSD
Flat size : 16.8MiB
Description :
PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open
Source general-purpose scripting language that is especially suited for
Web development and can be embedded into HTML. Its syntax draws upon C,
Java, and Perl, and is easy to learn. The main goal of the language is to
allow web developers to write dynamically generated webpages quickly, but
you can do much more with PHP.
WWW: http://www.php.net/
[alexus@j ~]$
4 Thông báo để gửi.:
Trả về giá trịopenlog() is not available in Windows.
Trả về [alexus@j ~]$ pkg info php56
php56-5.6.12
Name : php56
Version : 5.6.12
Installed on : Thu Aug 20 08:57:22 EDT 2015
Origin : lang/php56
Architecture : freebsd:9:x86:64
Prefix : /usr/local
Categories : www lang devel
Licenses : PHP301
Maintainer :
WWW : http://www.php.net/
Comment : PHP Scripting Language
Options :
CGI : on
CLI : on
DEBUG : off
DTRACE : off
EMBED : off
FPM : on
IPV6 : on
LINKTHR : on
MAILHEAD : off
PHPDBG : off
ZTS : off
Shared Libs required:
libxml2.so.2
libpcre.so.1
libiconv.so.2
Annotations :
cpe : cpe:2.3:a:php:php:5.6.12:::::freebsd9:x64
repo_type : binary
repository : FreeBSD
Flat size : 16.8MiB
Description :
PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open
Source general-purpose scripting language that is especially suited for
Web development and can be embedded into HTML. Its syntax draws upon C,
Java, and Perl, and is easy to learn. The main goal of the language is to
allow web developers to write dynamically generated webpages quickly, but
you can do much more with PHP.
WWW: http://www.php.net/
[alexus@j ~]$
5 khi thành công hoặc [alexus@j ~]$ pkg info php56
php56-5.6.12
Name : php56
Version : 5.6.12
Installed on : Thu Aug 20 08:57:22 EDT 2015
Origin : lang/php56
Architecture : freebsd:9:x86:64
Prefix : /usr/local
Categories : www lang devel
Licenses : PHP301
Maintainer :
WWW : http://www.php.net/
Comment : PHP Scripting Language
Options :
CGI : on
CLI : on
DEBUG : off
DTRACE : off
EMBED : off
FPM : on
IPV6 : on
LINKTHR : on
MAILHEAD : off
PHPDBG : off
ZTS : off
Shared Libs required:
libxml2.so.2
libpcre.so.1
libiconv.so.2
Annotations :
cpe : cpe:2.3:a:php:php:5.6.12:::::freebsd9:x64
repo_type : binary
repository : FreeBSD
Flat size : 16.8MiB
Description :
PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open
Source general-purpose scripting language that is especially suited for
Web development and can be embedded into HTML. Its syntax draws upon C,
Java, and Perl, and is easy to learn. The main goal of the language is to
allow web developers to write dynamically generated webpages quickly, but
you can do much more with PHP.
WWW: http://www.php.net/
[alexus@j ~]$
6 khi thất bại.
- Ví dụ
- Ví dụ #1 Sử dụng Syslog ()
- Ghi chú
Trên Windows, dịch vụ Syslog được mô phỏng bằng nhật ký sự kiện. ¶
Ghi chú:
[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
1[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
2[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
3[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
4[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
5[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
6[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
7
Sử dụng [alexus@j ~]$ pkg info php56
php56-5.6.12
Name : php56
Version : 5.6.12
Installed on : Thu Aug 20 08:57:22 EDT 2015
Origin : lang/php56
Architecture : freebsd:9:x86:64
Prefix : /usr/local
Categories : www lang devel
Licenses : PHP301
Maintainer :
WWW : http://www.php.net/
Comment : PHP Scripting Language
Options :
CGI : on
CLI : on
DEBUG : off
DTRACE : off
EMBED : off
FPM : on
IPV6 : on
LINKTHR : on
MAILHEAD : off
PHPDBG : off
ZTS : off
Shared Libs required:
libxml2.so.2
libpcre.so.1
libiconv.so.2
Annotations :
cpe : cpe:2.3:a:php:php:5.6.12:::::freebsd9:x64
repo_type : binary
repository : FreeBSD
Flat size : 16.8MiB
Description :
PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open
Source general-purpose scripting language that is especially suited for
Web development and can be embedded into HTML. Its syntax draws upon C,
Java, and Perl, and is easy to learn. The main goal of the language is to
allow web developers to write dynamically generated webpages quickly, but
you can do much more with PHP.
WWW: http://www.php.net/
[alexus@j ~]$
8 đến [alexus@j ~]$ pkg info php56
php56-5.6.12
Name : php56
Version : 5.6.12
Installed on : Thu Aug 20 08:57:22 EDT 2015
Origin : lang/php56
Architecture : freebsd:9:x86:64
Prefix : /usr/local
Categories : www lang devel
Licenses : PHP301
Maintainer :
WWW : http://www.php.net/
Comment : PHP Scripting Language
Options :
CGI : on
CLI : on
DEBUG : off
DTRACE : off
EMBED : off
FPM : on
IPV6 : on
LINKTHR : on
MAILHEAD : off
PHPDBG : off
ZTS : off
Shared Libs required:
libxml2.so.2
libpcre.so.1
libiconv.so.2
Annotations :
cpe : cpe:2.3:a:php:php:5.6.12:::::freebsd9:x64
repo_type : binary
repository : FreeBSD
Flat size : 16.8MiB
Description :
PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open
Source general-purpose scripting language that is especially suited for
Web development and can be embedded into HTML. Its syntax draws upon C,
Java, and Perl, and is easy to learn. The main goal of the language is to
allow web developers to write dynamically generated webpages quickly, but
you can do much more with PHP.
WWW: http://www.php.net/
[alexus@j ~]$
9 cho tham số [alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
0 của OpenLog () không có sẵn trong Windows. ¶
Xem thêm
[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
8[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
9<?php
phpinfo();
?>
0<?php
phpinfo();
?>
1 OpenLog () - Kết nối mở với logger hệ thống ¶
Closelog () - Đóng kết nối với bộ ghi hệ thống
<?php
phpinfo();
?>
2<?php
phpinfo();
?>
3<?php
phpinfo();
?>
4<?php
phpinfo();
?>
5<?php
phpinfo();
?>
6<?php
phpinfo();
?>
7<?php
phpinfo();
?>
8<?php
phpinfo();
?>
9Server error (500)
0
[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
7 Syslog.Filter INI Cài đặt (bắt đầu bằng Php 7.3) ¶
Stevekamerman tại Gmail Dot Com ¶
Server error (500)
2
Server error (500)
3
Server error (500)
4
Server error (500)
5
Server error (500)
6
[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
7 4 năm trước ¶
Owm ¶
Server error (500)
8
Server error (500)
9
error_log
0
error_log
1
error_log
2
error_log
3
error_log
4
[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
7 Helly tại php dot net ¶ ¶
15 năm trước
error_log
6
error_log
7
[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
7 Huangyg11 tại Gmail Dot Com ¶ ¶
7 năm trước
error_log
9
phpinfo();
0
[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
7
Antoine Dot Leverve Dot ext tại Zodiacaerospace Dot Com ¶ ¶
6 năm trước
phpinfo();
2
phpinfo();
3
phpinfo();
4
[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
7 Daniele Dot Patoner tại Biblio Dot Unitn Dot it ¶ ¶
19 năm trước
phpinfo();
6
phpinfo();
7
phpinfo();
8
phpinfo();
9
php
0
php
1
php
2
[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
7 Mavetju tại Chello Dot NL ¶ ¶
21 năm trước
php
4
php
5
[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
7 Ẩn danh ¶ ¶
11 thàng trước
php
7
dpreece tại Paradise dot net dot nz nz ¶ ¶
20 năm trước
php
8
php
9
php.ini
0
php.ini
1
php.ini
2
php.ini
3
php.ini
4
php.ini
5
[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
7 Torsten ¶ ¶
18 năm trước
php.ini
7
RCGRAVES+PHP tại Brandeis Dot Edu ¶ ¶
22 năm trước
php.ini
8
php.ini
9
local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log
00local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log
01local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log
02[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
7 Adam _at_ LockdownNetworks _DOT_ com ¶ ¶
15 năm trước
local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log
04[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$
9local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log
06local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log
07 Gherson tại snet dot net ¶ ¶
21 năm trước
local3.* -/home/USERNAME/logs/php.log
local3.* -/var/log/php.log
08