Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的生产日志 1GB,当大小达到 1GB 时,我需要自动设置 logrotate。我正在使用 rails 3,ruby 1.9.3。如何旋转登录轨道?谁能帮我吗?提前致谢。
要创建一个记录器,该记录器一旦达到大约 102,400,000 字节就会老化日志文件并留下 10 个旧日志文件:
require 'logger' logger = Logger.new('foo.log', 10, 102_400_000) #10 logs, about 1 GB all together