What SeasLog currently offers
-
Convenient and standardized log recording in PHP projects
-
Configurable default log directory and modules
-
Specify the log directory and get the current configuration
SeasLog’s goal
-
Convenient and standardized log recording
-
Efficient massive log analysis
-
Configurable, multi-channel log warning
SeasLog compile and install
- cd SeasLog/
-
- phpize
-
- ./configure --with-php-config=php-config
-
- make
- make install
Copy code
seaslog.ini
- ; configuration for php SeasLog module
- extension=seaslog.so
- seaslog.default_basepath = /log/seaslog-test
- seaslog.default_logger = default
Copy code
Demo :
- /**
- * @author ciogao@gmail.com
- * Date: 14-1-27 4:41 pm
- */
- echo '
';
- var_dump(SEASLOG_TYPE_INFO);
- var_dump(SEASLOG_TYPE_WARN);
- var_dump(SEASLOG_TYPE_ERRO);
-
-
- var_dump(seaslog_get_basepath());
- var_dump(seaslog_get_lastlogger());
- var_dump(seaslog_get_basepath());
- var_dump(seaslog('test info'));
- var_dump(seaslog('test warning', SEASLOG_TYPE_WARN));
- var_dump(seaslog('test error', SEASLOG_TYPE_ERRO));
-
-
- var_dump(seaslog_set_basepath('/log/base_test'));
- var_dump(seaslog_set_logger('testModule/app1'));
- var_dump(seaslog('test info 2'));
- var_dump(seaslog('test warning 2', SEASLOG_TYPE_WARN));
- var_dump(seaslog('test error 2', SEASLOG_TYPE_ERRO));
- var_dump(seaslog_get_basepath());
- var_dump(seaslog_get_lastlogger() );
- var_dump(seaslog_get_basepath());
-
-
- var_dump(seaslog('test error 3', SEASLOG_TYPE_ERRO, 'test/bb'));
-
- echo "n";
Copy code
project Home page: http://www.open-open.com/lib/view/home/1391827042473
|