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

修改log-level=error的时候项目每次请求报错问题 #170

Closed
wants to merge 1 commit into from

Conversation

lizhq
Copy link

@lizhq lizhq commented Mar 7, 2024

当配置文件为
retrofit.auto-set-prototype-scope-for-path-math-interceptor = false retrofit.global-log.enable=true
retrofit.global-log.log-strategy=None
retrofit.global-log.log-level=error

项目运行过程中,每次请求总是有以下错误
2024-03-07 10:26:58.865 ERROR 40676 --- [nio-8090-exec-1] c.g.l.r.s.boot.log.LoggingInterceptor :

排查发现主要是,当聚合模式开启时候
buffer默认初始化的时候加了一个回车换行符导致

我使用的版本是 2.3.14 , 但是日志模块原则上跟Springboot的版本无关。 请 添明 判断代码添加位置是否合理。

当配置文件为
retrofit.auto-set-prototype-scope-for-path-math-interceptor = false
retrofit.global-log.enable=true
retrofit.global-log.log-strategy=None
retrofit.global-log.log-level=error

项目运行过程中,每次请求总是有以下错误
2024-03-07 10:26:58.865 ERROR 40676 --- [nio-8090-exec-1] c.g.l.r.s.boot.log.LoggingInterceptor    : 



排查发现主要是,当聚合模式开启时候
buffer默认初始化的时候加了一个回车换行符导致

我使用的版本是 2.3.14 , 但是日志模块原则上跟Springboot的版本无关。 请 `添明` 判断代码添加位置是否合理。
@chentianming11
Copy link
Collaborator

这个问题是因为retrofit.global-log.log-strategy=None,表示不需要打印日志。但是聚合日志实现有问题,在这种情况下仍然会打印一行空日志导致的,该问题最新版本2.4.1或者3.1.1已修复。

不过正常情况下,如果不需要打印日志,可以关闭日志打印即可,etrofit.global-log.enable=true

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

Successfully merging this pull request may close these issues.

None yet

2 participants