TarsCloud / Tars

Tars is a high-performance RPC framework based on name service and Tars protocol, also integrated administration platform, and implemented hosting-service via flexible schedule.
BSD 3-Clause "New" or "Revised" License
9.79k stars 2.08k forks source link

After version 1.7, the log is annotated with @ slf4j directly. I can't see the log. Do I need to configure it? #665

Closed TARS-Question closed 4 years ago

TARS-Answer commented 4 years ago

After 1.7, logback is used by default, and the log output of logback can be configured. The logs of the kernel are also unified into one log controller, so there will not be multiple log controllers in the original time. This log output has little to do with @ slf4. You can see the process of log processing at that time, and then locate the log output.

TARS-Answer commented 4 years ago

1.7后默认使用logback,配置logback的日志输出即可。内核的日志也统一到了一个日志控制器,不会在原本的时候出现多个日志控制器的情况。这个日志输出和@Slf4关系不大,可以看看当时日志处理的时候流程是怎么样的,再定位日志输出的情况。

TARS-Question commented 4 years ago

The log cannot be seen in the management background. What should be configured? Version 1.6 is directly printed to the STD file; version 1.7 does not exist in the background file.

TARS-Question commented 4 years ago

日志在管理后台看不到,是不是要配置什么?1.6版本,直接就打印到std文件里了;1.7版本管理后台的文件里就没有了。

TARS-Answer commented 4 years ago

The 1.7 version is also printed to the console by default, or there will be.

TARS-Answer commented 4 years ago

1.7版本默认也是打印到控制台的,还是会有的。

TARS-Question commented 4 years ago

System.out.println () information can be displayed in the management background, log.info () will not be displayed.

It seems that the log of version 1.7 can only use logback. You can see that there is a context conversion in the program. After relying on tars, it can't be replaced with other log frameworks. Will you consider optimization in this follow-up?

TARS-Question commented 4 years ago

System.out.println()的信息在管理后台能显示,log.info()的就不会显示。

1.7版本的日志好像只能用logback,看到程序里有context转换,依赖了tars之后就不能替换成其它的日志框架了,这个后续会考虑优化吗?

TARS-Answer commented 4 years ago

It has nothing to do with this, log.info Show that the two have nothing to do with each other. To see if the project has other log controller conflicts, you can see the project dependencies.

The MDC of logback can also support context processing without conflict. You can use Maven's dependencies to see if there are multiple log controllers, and you can delete them.

TARS-Answer commented 4 years ago

和这个没有关系,log.info展示这两个没有任何的关系。看看项目是不是有其他的日志控制器冲突了,可以看看项目依赖。 context上下文的处理,现在logback的MDC也可以支持,并不冲突。可以用maven的dependencies看看是不是有多个日志控制器的情况,exclude掉即可。