SeasLog 1.8.6 发布,包含多项功能改进,及Bug修复。 更新内容: 1.8.6 [重要] New Feature #218 添加SeasLog::closeLoggerStream(),解决CLI模式下文件删除后操作符释放问题。 New Feature 新增数据收集建议文档. New Feature 新增bench_mark.php批量测试脚本 Fixed 解决check_log_level:log 中level级别匹配性能问题 Fixed 解决phpdbg下core dump问题. Fixed 解决分析脚本中smtp_secure和smtp_mailer问题. Fixed issue #125 #203 添加配置项 seaslog.buffer_disabled_in_cli,默认为false. Fixed issue #196 解决php5.3.x 下undefined symbol: expand_filepath_with_mode问题. Fixed issue #195 修复rsyslog 使用 RFC5424 接收问题. Fixed issue #200 当tcp/udp发生错误时提行提示. Fixed issue #202 添加完整单元测试. Fixed issue #210 添加配置项seaslog.remote_timeout, 默认为1秒. Fixed issue #215 修复analyzerCount统计错误问题. Fixed issue #228 修复analyzerDetail查询错误问题.
1.8.4 New Feature #162 Configure seaslog.recall_depth support for filename and code line. New Feature #170 Configure seaslog.trace_notice and seaslog.trace_warning support trace notice and warning. New Feature #172 Configure seaslog.disting_folder support switch {Logger}/{Time}[.Type].log or {Logger}_{Time}[.Type].log. New Feature #174 Add %U(MemoryUsage) and %u(PeakMemoryUsage) into default variable table. New Feature #186 Use seaslog_throw_exception replace zend_error. Fixed issue #65 Message template content match error. Fixed issue #153 Disting_by_hour and disting_type can not use together. Fixed issue #156 Log template format error with %L and %M. Fixed issue #158 SeasLog::setRequestID intercepted error. Fixed issue #165 Phpdbg seg fault. Fixed issue #184 SeasLog::analyzerCount seg fault at PHP7-nts. Fixed issue #181 Perfect when stream's connection was broken.
1.7.6 1.7.5 License更新,从Apache License 2.0 更新到 PHP License 3.01. 遵循RFC5424规范发送到 Rsyslog(TCP/UDP) 支持 RequestId 区分请求 fixed issue #134. 支持日志格式自定义 fixed issue #12 #143. 更新 Analyzer 脚本版本至 1.1.0, fixed issue #139. 优化analyzerCount 和 analyzerDetail 统计函数性能,fixed issue #133. Fixed issue #138. Error by file exists. Fixed issue #140. Error by setDatetimeFormat. Fixed issue #142. Error by too many open files. Fixed issue #144. Error by read log detail order desc. Fixed issue #145. Error by analyzerDetail. Fixed issue #146. Segfault at php-fpm.
附1:PECL项目主页http://pecl.php.net/package/SeasLog 附2:GitHub项目主页https://github.com/SeasX/SeasLog 附3: 码云项目主页https://gitee.com/neeke/SeasLog SeasLog Yet a log extension for PHP.A effective,fast,stable log extension for PHP @author Chitao.Gao [neeke@php.net] 为什么使用SeasLoglog日志,通常是系统或软件、应用的运行记录。通过log的分析,可以方便用户了解系统或软件、应用的运行情况;如果你的应用log足够丰富,也可以分析以往用户的操作行为、类型喜好、地域分布或其他更多信息;如果一个应用的log同时也分了多个级别,那么可以很轻易地分析得到该应用的健康状况,及时发现问题并快速定位、解决问题,补救损失。 php内置error_log、syslog函数功能强大且性能极好,但由于各种缺陷(error_log无错误级别、无固定格式,syslog不分模块、与系统日志混合),灵活度降低了很多,不能满足应用需求。 好消息是,有不少第三方的log类库弥补了上述缺陷,如log4php、plog、Analog等(当然也有很多应用在项目中自己开发的log类)。其中以log4php最为著名,设计精良、格式完美、文档完善、功能强大。推荐。 不过log4php在性能方面表现非常差,下图是SeasLog与log4php的ab并发性能测试( 测试环境:Ubuntu12.04单机,CPU I3,内存 16G,硬盘 SATA 7200): 
那么有没有一种log类库满足以下需求呢: 分模块、分级别 配置简单(最好是勿须配置) 日志格式清晰易读 应用简单、性能很棒
SeasLog 正是应此需求而生。 目前提供了什么在PHP项目中便捷、规范地记录log 可配置的默认log目录与模块 指定log目录与获取当前配置 初步的分析预警框架 高效的日志缓冲、便捷的缓冲debug 遵循 PSR-3 日志接口规范 连接TCP端口,以RFC5424格式发送日志 连接UDP端口,以RFC5424格式发送日志 支持RequestId区分请求 支持日志模板自定义
目标是怎样的便捷、规范的log记录 高效的海量log分析 可配置、多途径的log预警
SeasLog的性能究竟怎么样
当SeasLog不开启buffer时,SeasLog是: 当SeasLog开启buffer且buffer_size为100时,SeasLog是: bench_mark文件位置:https://github.com/SeasX/SeasLog/blob/master/tests/bench_mark.php 预设变量表SeasLog提供了下列预设变量,可以直接使用在日志模板中,将在日志最终生成时替换成对应值。 %L - Level 日志级别。 %M - Message 日志信息。 %T - DateTime 如2017-08-16 19:15:02,受seaslog.default_datetime_format影响。 %t - Timestamp 如1502882102.862,精确到毫秒数。 %Q - RequestId 区分单次请求,如没有调用SeasLog::setRequestId($string)方法,则在初始化请求时,采用内置的static char *get_uniqid()方法生成的惟一值。 %H - HostName 主机名。 %P - ProcessId 进程ID。 %D - Domain:Port 域名:口号,如www.cloudwise.com:8080; Cli模式下为cli。 %R - Request URI 请求URI,如/app/user/signin; Cli模式下为入口文件,如CliIndex.php。 %m - Request Method 请求类型,如GET; Cli模式下为执行命令,如/bin/bash。 %I - Client IP 来源客户端IP; Cli模式下为local。取值优先级为:HTTP_X_REAL_IP > HTTP_X_FORWARDED_FOR > REMOTE_ADDR %F - FileName:LineNo 文件名:行号,如UserService.php:118。 %U - MemoryUsage 当前内容使用量,单位byte。调用zend_memory_usage。 %u - PeakMemoryUsage 当前内容使用峰值量,单位byte。调用zend_memory_peak_usage。 %C - TODO Class::Action 类名::方法名,如UserService::getUserInfo。
|