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