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. 从Java synchronized和volatile说起

    请参看https://www.cnblogs.com/chengxiao/p/6528109.html这个链接,说的特别好

  2. 两个已排序数组的合并-C语言

    最近在纸上写一个已排序数组的合并时,花了超过预期的时间.仔细想想,这种要放到毕业找工作那会两下就出来了,原因还在于工作后对基础没有重视,疏于练习. 说开一点,现在搜索引擎的发达确实给问题的解决带来了便 ...

  3. TFS强制删除离职人员签出锁定项的方法(转)

      项目组一哥们走的时候以独占方式迁出了文件,现在其他人都无法修改,管理员似乎也无法将文件解除.经过摸索,找到了一种暴力的方法——直接改TFS数据库.虽然暴力,却能实实在在地解决这个问题. 步骤: 1 ...

  4. Android(java)学习笔记181:多媒体之图片画画板案例

    1.首先我们编写布局文件activity_main.xml如下: <RelativeLayout xmlns:android="http://schemas.android.com/a ...

  5. 进程池_Pool

    当需要创建子进程数量不多的时候,可以直接利用multiprocessing中的Process动态生成多个进程 但是如果是成百甚至上千个任务,手动地创建它的工作量很大,此时就可以利用到multiproc ...

  6. 数据库sql语句limit区别

    注意:并非所有的数据库系统都支持 SELECT TOP 语句. MySQL 支持 LIMIT 语句来选取指定的条数数据, Oracle 可以使用 ROWNUM 来选取. SQL Server / MS ...

  7. zabbix4.2学习笔记系列

    写在前面:对zabbix的接触始于对监控的了解,网上比较多zabbix相关博客,比较多基于3系列甚至2系列,最新开发版zabbix4.2版本已经出来,本博客基于4.2版本学习,参考官网4.2版本和网上 ...

  8. ping ip

    def ip_and_time(): """ get ip to ping from ip.txt then return two list , each ip that ...

  9. 从零开始--系统深入学习Android

    http://www.cnblogs.com/tianjian/category/354587.html

  10. [LUOGU] P2920 [USACO08NOV]时间管理Time Management

    见7.3测试 #include<iostream> #include<algorithm> #include<cstdio> using namespace std ...