Spring Boot服务中的日志轮换 [英] Log rotation in Spring Boot service

查看:141
本文介绍了Spring Boot服务中的日志轮换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将Spring Boot 2.0.0-RC1应用程序部署为解决方案

我找到了解决方案,它是init.d service, but I can't figure out how to configure the log rotation. The app logs to /var/log/appname.log, but if I configure logrotate the logging stops after a rotation, because a new file is created, and the stdout/stderr redirection defined in the embedded script does not work anymore.

If I configure the log rotation in my logging system there are two problems: I can't create the files in /var/log, and I still have the redirection defined in the embedded script.

What is the proper solution for this?

解决方案

I found the solution, it's the option copytruncate in logrotate.

这篇关于Spring Boot服务中的日志轮换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆