• log4c log4crc 配置详解


    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE log4c SYSTEM "">
    <log4c version="1.2.1">
    <config>
    <bufsize>0</bufsize>
    <debug level="2"/>
    <nocleanup>0</nocleanup>
    <reread>1</reread>
    </config>

    <category name="root" priority="notice"/>
    <category name="linuxany.com" priority="debug" appender="stderr" />
    <category name="log4ctest" priority="debug" appender="myrollingfileappender" />

    <rollingpolicy name="myrollingpolicy" type="sizewin" maxsize="104857600" maxnum="10" />  
            <!--sizewin 表示达到最大值后新建日志文件  值由maxsize设定
                maxnum  最大文件数目 
             -->
     
    <appender name="myrollingfileappender" type="rollingfile" logdir="./" prefix="mylogfile" layout="dated" rollingpolicy="myrollingpolicy" />
           <!--logdir 日志输出路径
               prefix  文件名
               layout 输出格式 (与下方layout对应)
                  例如dated为:
                      20110727 09:21:10.167 WARN     log4ctest- [    main.c][  57][      main()]: shit!-99947
                      20110727 09:21:10.167 WARN     log4ctest- [    main.c][  57][      main()]: shit!-99948
                      20110727 09:21:10.167 WARN     log4ctest- [    main.c][  57][      main()]: shit!-99949
                  basic为:
                      WARN     log4ctest - [    main.c][  57][      main()]: shit!-99982
                      WARN     log4ctest - [    main.c][  57][      main()]: shit!-99983
                      WARN     log4ctest - [    main.c][  57][      main()]: shit!-99984
                      WARN     log4ctest - [    main.c][  57][      main()]: shit!-99985              
            -->
    <appender name="stdout" type="stream" layout="basic"/>
    <appender name="stderr" type="stream" layout="dated"/>
    <appender name="syslog" type="syslog" layout="basic"/>
    <appender name="s13file" type="s13_file" layout="basic"/>
    <appender name="plain_stderr" type="s13_stderr" layout="none"/>
    <appender name="cat_stderr" type="s13_stderr" layout="catlayout"/>
    <appender name="xml_stderr" type="s13_stderr" layout="xmllayout"/>
    <appender name="user_stderr" type="s13_stderr" layout="userlayout"/>

    <layout name="basic" type="basic"/>
    <layout name="dated" type="dated"/>
    <layout name="catlayout" type="s13_cat"/>
    <layout name="xmllayout" type="s13_xml"/>
    <layout name="none" type="s13_none"/>
    <layout name="userlayout" type="s13_userloc"/>

    </log4c>

      

  • 相关阅读:
    变量
    匿名函数与内建函数
    Datanode denied communication with namenode because hostname cannot be resol
    0003.搭建Hadoop的环境
    0001.大数据课程概述与大数据背景知识
    享学首创年薪阿里60W+/对标P7岗移动 架构师成长路线V3.0 ---- Android移动互联网架构开发
    FFmpeg和WebRTC的区别
    查看每个文件下内存占用大小
    linux 删除中文乱码
    FFmpeg 命令大全
  • 原文地址:https://www.cnblogs.com/wangkangluo1/p/2118667.html
Copyright © 2020-2023  润新知