php 之 日志系统seaslog


特点:

  1、高性能(使用C语言编写的)。

  2、无需配置。

  3、功能完善、使用简单。


安装:

  打开php的扩展官网:https://pecl.php.net/

  然后搜索Seaslog,

  选择最新的版本下载:

wget https://pecl.php.net/get/SeasLog-1.8.4.tgz

解压:

tar zxvf SeasLog-1.8..tgz 

然后进入SeasLog目录

cd SeasLog-1.8./

然后执行phpize:

关于什么是phpize,参考博客:https://blog.csdn.net/qq_16399991/article/details/70577740。

phpize

如果显示命令未找到:

就先安装php-dev:

sudo apt-get install php5-dev

下一步,执行configure:

./configure 

如果报错,显示命令未找到php-config,就需要添加自己的php路径:

./configure -- with-php-config=/usr/local/php/bin/php-config

下一步:

sudo make && make install

如果提示目录没有权限,就修改指定目录的权限。

安装结果:

See any operating system documentation about shared libraries for
more information, such as the ld() and ld.so() manual pages.
---------------------------------------------------------------------- Build complete.
Don't forget to run 'make test'. Installing shared extensions:

进入目录查看:

cd /usr/lib/php5//

可以看到:seaslog.so。

然后修改php.ini文件。

如果不知道php.ini文件在哪,可以通过phpinfo查看。

Nginx:

Loaded Configuration File /etc/php5/fpm/php.ini

apache:

Loaded Configuration File  /etc/php5/apache2

打开php.ini,增加一行:

extension = "seaslog.so"

然后重启nginx服务或apache服务,再查看phpinfo,就可以看到安装成功。

打开Seaslog的github:https://github.com/SeasX/SeasLog

找到Seaslog.ini,复制内容到php.ini中。

;configuration for php SeasLog module
extension = seaslog.so ;Default Log Base Path
seaslog.default_basepath = "/var/log/www" ;Default Logger Path
seaslog.default_logger = "default" ;The DateTime Style. Default "Y-m-d H:i:s"
seaslog.default_datetime_format = "Y-m-d H:i:s" ;Default Log template.
;Default "%T | %L | %P | %Q | %t | %M"
seaslog.default_template = "%T | %L | %P | %Q | %t | %M" ;Switch use the logger with folder.
;-Y(Default) -N
seaslog.disting_folder = ;Switch use the logger with type.
;-Y -N(Default)
seaslog.disting_type = ;Switch use the logger with hour.
;-Y -N(Default)
seaslog.disting_by_hour = ;Switch use the log buffer with memory.
;-Y -N(Default)
seaslog.use_buffer = ;The buffer size
seaslog.buffer_size = ;disable buffer in cli
;-Y -N(Default)
seaslog.buffer_disabled_in_cli = ;Record logger level.
;-EMERGENCY -ALERT -CRITICAL -ERROR -WARNING -NOTICE -INFO -DEBUG -ALL
;Default (All of them).
;
; Tips: The configuration item has changed since the 1.7. version.
; Before the 1.7. version, the smaller the value, the more logs are taken according to the level:
; -all -debug -info -notice -warning -error -critical -alert -emergency
; Before the 1.7. version, Default (All of them).
seaslog.level = ;Log function recall depth
;Will affected variable `LineNo` in `%F`
;Default
seaslog.recall_depth = ;Automatic Record notice with default logger
;-Y -N(Default)
seaslog.trace_notice = ;Automatic Record warning with default logger
;-Y -N(Default)
seaslog.trace_warning = ;Automatic Record final error with default logger.
;-Y(Default) -N
seaslog.trace_error = ;Automatic Record exception with default logger.
;-Y -N(Default)
seaslog.trace_exception = ;Switch the Record Log Data Store.
;1File 2TCP 3UDP (Switch default )
seaslog.appender = ;Record Log Retry Count
;Default (Do Not Retry)
seaslog.appender_retry = ;If you use Record TCP or UDP, configure this remote ip.
;Default "127.0.0.1"
seaslog.remote_host = "127.0.0.1" ;If you use Record TCP or UDP, configure this remote port.
;Default
seaslog.remote_port = ;If you use Record TCP or UDP, configure this remote timeout.
;Default second
seaslog.remote_timeout = ;Trim the \n and \r in log message.
;-On -Off(Default)
seaslog.trim_wrap = ;Switch throw SeasLog exception.
;-On(Default) -Off
seaslog.throw_exception = ;Switch ignore SeasLog warning.
;-On(Default) -Off
seaslog.ignore_warning =

php 之 日志系统seaslog安装的更多相关文章

  1. php的高性能日志系统 seaslog 的安装与使用

    一.什么是日志系统    一般用于记录系统运行时的信息,一般分为三类:系统日志,应用程序日志,安全日志.日志功能不能影响用户的正常使用. 二.为什么需要日志功能    1.了解系统运行情况    2. ...

  2. PHP扩展高性能日志系统SeasLog简单上手

    Windows部分:-------------------------------------------------------- https://pecl.php.net/package/Seas ...

  3. kubernetes集群EFK日志系统搭建

    日志收集架构 Kubernetes 集群本身不提供日志收集的解决方案,一般来说有主要的3种方案来做日志收集: 在节点上运行一个 agent 来收集日志 在 Pod 中包含一个 sidecar 容器来收 ...

  4. 【树莓派2B倒腾日志】之安装系统及配置

    15号树莓派到手到现在,折腾了也有一小周,自己摸索着,装了系统,登上SSH,更新了源,连了VNC,换上wifi,亮了小灯.再到今天捣鼓了下数码管,回头想想,该写个日志记录一下这一周的所得,自己总结也方 ...

  5. 分布式实时日志系统(一)环境搭建之 Jstorm 集群搭建过程/Jstorm集群一键安装部署

    最近公司业务数据量越来越大,以前的基于消息队列的日志系统越来越难以满足目前的业务量,表现为消息积压,日志延迟,日志存储日期过短,所以,我们开始着手要重新设计这块,业界已经有了比较成熟的流程,即基于流式 ...

  6. 高性能PHP日志插件--Seaslog

    日志系统作为记录系统运行的信息,包括 用户输入,安全日志等,日志系统是不能影响用户的使用. 为什么需要记录日志? 既然日志系统增加了整个系统的开销,为什么我还需要它,这是因为日志能帮我们记录运行的很多 ...

  7. 如何在win7系统中安装redis

    转载于:http://www.itxuexiwang.com/a/shujukujishu/redis/2016/0216/92.html?1455871954 如何在win7系统中安装redis​ ...

  8. DNS主从服务,子域授权,view视图,日志系统,压力测试

    DNS主从服务,子域授权,view视图,日志系统,压力测试 DNS性能测试工具queryperfDNS查询过程: DNS主从建立: 环境: 主服务器:10.140.165.93 从服务器:10.140 ...

  9. 使用SharePoint Designer定制开发员工工作日志系统实例!

    昨天已介绍了一篇<使用SharePoint Designer定制开发专家库系统实例!>,今天继续来介绍使用SharePoint Designer定制开发员工工作日志系统实例,主要功能包括填 ...

随机推荐

  1. zabbix server端配置

    # wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.0.6/zabbix-2.0.6.tar. ...

  2. Linux PHP的运行模式

    关系图 首先聊一下服务器,常见的web server类型有apache和nginx Apache工作模式 Apache的工作模式是Apache服务器在系统启动后,预先生成多个进程副本驻留在内存中,一旦 ...

  3. function语句注意事项

    function语句 在Javascript中定义一个函数,有两种写法: function foo() { } 和 var foo = function () { } 两种写法完全等价.但是在解析的时 ...

  4. C++ new delete(二)

    C++基础遗漏:new和delete 我记得当年学习C++基础的时候,老师曾经告诉我们:一般来说new和delete要成对出现,在使用完new申请的内存后要马上释放.我相信持这种说法的人不止我们老师一 ...

  5. IOS学习笔记3—Objective C—简单的内存管理

    今天简述一下简单的内存管理,在IOS5.0以后Apple增加了ARC机制(Automatic Reference Counting),给开发人员带来了不少的方便,但是为了能更好的理解IOS内存管理机制 ...

  6. JS简单实现防抖和节流

    一.什么是防抖和节流 Ps: 比如搜索框,用户在输入的时候使用change事件去调用搜索,如果用户每一次输入都去搜索的话,那得消耗多大的服务器资源,即使你的服务器资源很强大,也不带这么玩的. 1. 防 ...

  7. vs编译应用程序不依赖运行vs环境

    控制台应用程序不依赖VS运行环境就可以运行的设置: 1,使用release模式编译 2,项目属性中,“C/C++”,“代码生成”中的运行库改为“多线程(/MT)” 3,项目属性中,“链接器”,“系统” ...

  8. java读取配置文件的推荐方法getResource、getResourceAsStream

    在java开发中经常会读取配置文件,如果把文件路径写死,就太LOW了,也不符合编码规范. 在网上找了一些资料后,发现有两种方法:xxx.class.getResource("")  ...

  9. phpStrom+xdebug调试php

    1>xdebug下载 1.1>xdebug官网可以根据phpinfo()源代码来提供对应版本的xdebug,地址:https://xdebug.org/wizard.php 如下截图 1. ...

  10. 蓝牙bluez学习(1) Stack Architecture

    Bluez支持的features Core Specification 4.2 (GAP, L2CAP, RFCOMM, SDP, GATT) Classic Bluetooth (BR/EDR) B ...