Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

日志文件过大,无法滚动生成 #136

Open
linyelai opened this issue Mar 15, 2023 · 1 comment
Open

日志文件过大,无法滚动生成 #136

linyelai opened this issue Mar 15, 2023 · 1 comment

Comments

@linyelai
Copy link

java创建的服务,会创建一个默认应用名.服务名.log的日志文件,该文件会持续增长,是否可以默认不创建该文件

@TimmyYu
Copy link
Contributor

TimmyYu commented Mar 23, 2023

java服务的日志控器在1.7.2版本及以上。可以自由的控制 。可以配置sytem.out 到slf4j输出即可。
可以在maven中引入以下坐标

<dependency>
        <groupId>uk.org.lidalia</groupId>
        <artifactId>sysout-over-slf4j</artifactId>
        <version>1.0.2</version>
</dependency>

在启动的app.java文件 中增加如下语句:

SysOutOverSLF4J.sendSystemOutAndErrToSLF4J();

即可所有的系统日志都在slf4j -> logback的管控

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants