log.conf 1.2 KB

12345678910111213141516171819202122232425
  1. [global]
  2. #改变量可以不写,默认是true,如果使用设置为true时,Zlog就会严格检查所用格式和规则,否则,忽略所用格式和规则。
  3. strict init = true
  4. buffer min = 1024
  5. buffer max = 65536
  6. #转档指定锁文件,用于保证多进程下日志安全转档,使用默认的配置文件为锁文件。
  7. rotate lock file = /tmp/stalog.lock
  8. #日志访问权限,600 只允许当前用户访问
  9. file perms = 666
  10. [formats]
  11. #使用默认日志输出格式 "%d %V [%p %F %L] %m%n" 输出日志格式为:%-5V按照日志级别按照左对齐
  12. #2012-12-13 10:23:29 INFO [31668:test_hello.c:41] hello, zlog
  13. #simple = "%d.%-8.8us %-5V [%-8.8p.%-8.8t %F %L] %m%n"
  14. simple = "%d.%ms %m%n"
  15. #simple2 = "%d.%us %m%n"
  16. [rules]
  17. #优先级从低到高 debug info notice warn fatal debug大于等于debug的优先级都能给通过debug输出。
  18. my_cat.* >stderr;
  19. #当hello.txt文件大小大于10MB时,会将hello.txt->hello.txt.0 0代表不删除任何文件
  20. my_cat.* "../log/sta.log", 1mb * 10 ~ "../log/sta.log.#r";simple
  21. #my_cat.INFO "hello.txt",1MB ~ "hello-%d(%Y%m%d).#2s.txt";simple
  22. #my_cat.INFO "hello.txt",1MB;simple
  23. #my_cat.INFO "hello.txt",1MB;simple