zoukankan      html  css  js  c++  java
  • php 高效日志记录扩展seaslog 的使用

    群里交流,听说seaslog不错,此文旨在记录使用。

    $ wget https://github.com/Neeke/SeasLog/archive/master.zip
    $ unzip master.zip
    $ cd SeasLog-master/
    $ phpize
    $ ./configure
    $ make -j2 
    $ sudo make install
    

      

    [SeasLog]
    ;configuration for php SeasLog module
    extension = seaslog.so
    
    ;默认log根目录
    seaslog.default_basepath = "/var/log/www"
    
    ;默认logger目录
    seaslog.default_logger = "default"
    
    ;日期格式配置 默认"Y-m-d H:i:s"
    seaslog.default_datetime_format = "Y-m-d H:i:s"
    
    ;日志格式模板 默认"%T | %L | %P | %Q | %t | %M"
    seaslog.default_template = "%T | %L | %P | %Q | %t | %M"
    
    ;是否以目录区分Logger 1是(默认) 0否
    seaslog.disting_folder = 1
    
    ;是否以type分文件 1是 0否(默认)
    seaslog.disting_type = 0
    
    ;是否每小时划分一个文件 1是 0否(默认)
    seaslog.disting_by_hour = 0
    
    ;是否启用buffer 1是 0否(默认)
    seaslog.use_buffer = 0
    
    ;buffer中缓冲数量 默认0(不使用buffer_size)
    seaslog.buffer_size = 100
    
    ;记录日志级别,数字越大,根据级别记的日志越多。
    ;0-EMERGENCY 1-ALERT 2-CRITICAL 3-ERROR 4-WARNING 5-NOTICE 6-INFO 7-DEBUG 8-ALL
    ;默认8(所有日志)
    ;
    ;   注意, 该配置项自1.7.0版本开始有变动。
    ;   在1.7.0版本之前, 该值数字越小,根据级别记的日志越多: 
    ;   0-all 1-debug 2-info 3-notice 4-warning 5-error 6-critical 7-alert 8-emergency
    ;   1.7.0 之前的版本,该值默认为0(所有日志);
    seaslog.level = 8
    
    ;日志函数调用回溯层级
    ;影响预定义变量 %F 中的行数
    ;默认0
    seaslog.recall_depth = 0
    
    ;自动记录错误 默认1(开启)
    seaslog.trace_error = 1
    
    ;自动记录异常信息 默认0(关闭)
    seaslog.trace_exception = 0
    
    ;日志存储介质 1File 2TCP 3UDP (默认为1)
    seaslog.appender = 1
    
    ;写入重试次数
    ;默认0(不重试)
    seaslog.appender_retry = 0
    
    ;接收ip 默认127.0.0.1 (当使用TCP或UDP时必填)
    seaslog.remote_host = "127.0.0.1"
    
    ;接收端口 默认514 (当使用TCP或UDP时必填)
    seaslog.remote_port = 514
    
    ;过滤日志中的回车和换行符 (默认为0)
    seaslog.trim_wrap = 0
    
    ;是否开启抛出SeasLog自身异常  1开启(默认) 0否
    seaslog.throw_exception = 1
    
    ;是否开启忽略SeasLog自身warning  1开启(默认) 0否
    seaslog.ignore_warning = 1
    

     参数详解:https://github.com/Neeke/SeasLog/blob/master/README_zh.md

    composer可以安装库

    omposer require seasx/seas-logger
    

      

  • 相关阅读:
    1.27
    1.25
    Representation Learning with Contrastive Predictive Coding
    Learning a Similarity Metric Discriminatively, with Application to Face Verification
    噪声对比估计(负样本采样)
    Certified Adversarial Robustness via Randomized Smoothing
    Certified Robustness to Adversarial Examples with Differential Privacy
    Dynamic Routing Between Capsules
    Defending Adversarial Attacks by Correcting logits
    Visualizing Data using t-SNE
  • 原文地址:https://www.cnblogs.com/already/p/9524504.html
Copyright © 2011-2022 走看看