Home >Backend Development >PHP Tutorial >PHP logging extension: SeasLog

PHP logging extension: SeasLog

WBOY
WBOYOriginal
2016-07-25 09:12:311504browse
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

  1. cd SeasLog/
  2. phpize
  3. ./configure --with-php-config=php-config
  4. make
  5. make install
Copy code

seaslog.ini

  1. ; configuration for php SeasLog module
  2. extension=seaslog.so
  3. seaslog.default_basepath = /log/seaslog-test
  4. seaslog.default_logger = default
Copy code

Demo :

  1. /**
  2. * @author ciogao@gmail.com
  3. * Date: 14-1-27 4:41 pm
  4. */
  5. echo '
    ';
  6. var_dump(SEASLOG_TYPE_INFO);
  7. var_dump(SEASLOG_TYPE_WARN);
  8. var_dump(SEASLOG_TYPE_ERRO);
  9. var_dump(seaslog_get_basepath());
  10. var_dump(seaslog_get_lastlogger());
  11. var_dump(seaslog_get_basepath());
  12. var_dump(seaslog('test info'));
  13. var_dump(seaslog('test warning', SEASLOG_TYPE_WARN));
  14. var_dump(seaslog('test error', SEASLOG_TYPE_ERRO));
  15. var_dump(seaslog_set_basepath('/log/base_test'));
  16. var_dump(seaslog_set_logger('testModule/app1'));
  17. var_dump(seaslog('test info 2'));
  18. var_dump(seaslog('test warning 2', SEASLOG_TYPE_WARN));
  19. var_dump(seaslog('test error 2', SEASLOG_TYPE_ERRO));
  20. var_dump(seaslog_get_basepath());
  21. var_dump(seaslog_get_lastlogger() );
  22. var_dump(seaslog_get_basepath());
  23. var_dump(seaslog('test error 3', SEASLOG_TYPE_ERRO, 'test/bb'));
  24. echo "n";
Copy code

project Home page: http://www.open-open.com/lib/view/home/1391827042473



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