Home >Backend Development >PHP Tutorial >How to save iis logs across servers_PHP tutorial

How to save iis logs across servers_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 11:08:55924browse

Using the extensible features of the PHP tutorial to remotely save game user log information, here I temporarily call it tlog (establishing a tcp/ip connection with the file server, of course preferably udp), currently three functions are defined
tlog_init,tlog_record,tlog_close
tlog_init(ip,port) is used to connect to the file server where ip and port are the file server address and port respectively
tlog_record(message,file) The user sends the log content to be recorded and the log storage File
tlog_close closes the socket link generated by sending the log

$result = tlog_init("127.0.0.1", 9734);
if ($result) {
tlog_record("hello" . time(), '1.log');
tlog_record("hello world" . time(), '2.log');
tlog_close();
}
?>

We mainly modify config.m4, tlog.c, php_tlog.h to achieve the functions we want
Open config.m4,
Delete php_arg_enable(tlog, whether to enable tlog support, comment dnl
at the beginning of the line Delete [ --enable-tlog enable tlog support]) Comment dnl
at the beginning of the line Open php_tlog.h Add


php_function(tlog_init);
php_function (tlog_record); phpize My directory is /usr/local/webserver/php5.3.3, then this command is ./usr/local/webserver/php5.3.3/bin/phpize
./configure --with-php-config=/usr /local/webserver/php5.3.3/bin/php-config
make

sudo make install (Because I use ubuntu, I brought sudo mainly because of permission issues when creating extensions in the PHP installation directory)

Modify php.ini to add tlog.so extension

View phpinfo();

http://www.bkjia.com/PHPjc/444828.html
www.bkjia.com

truehttp: //www.bkjia.com/PHPjc/444828.htmlTechArticleUsing the php tutorial extensible feature to remotely save game user log information, here I temporarily call it tlog (with file The server establishes a tcp/ip connection, preferably udp). Currently, three are defined...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn