Closed miaozzZ closed 1 year ago
在linux下 log_file_handler_type 选1和5是一样的吧,看到这行代码 ConcurrentRotatingFileHandlerWithBufferInitiativeLinux = ConcurrentRotatingFileHandler
有1秒缓冲的似乎是在下面的class中实现的,想请教下为什么没有作为log_file_handler_type =1的默认实现呢 class ConcurrentRotatingFileHandlerWithBufferInitiativeLinux00000000
1秒缓冲虽然性能好,但不太友好,有时候有的人突然关闭代码,导致最后1秒内的日志可能没有记录下来。
因为 ConcurrentRotatingFileHandler 是使用了文件锁,文件锁在win平台频繁使用,会对日志性能降低50倍到100倍。在linux上文件锁会使日志写入性能降低3-5倍,linux上没那么迫切需要减少文件锁的频率。
谢谢答复~
在linux下 log_file_handler_type 选1和5是一样的吧,看到这行代码 ConcurrentRotatingFileHandlerWithBufferInitiativeLinux = ConcurrentRotatingFileHandler
有1秒缓冲的似乎是在下面的class中实现的,想请教下为什么没有作为log_file_handler_type =1的默认实现呢 class ConcurrentRotatingFileHandlerWithBufferInitiativeLinux00000000