You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logger problems occurs when use slf4j for logging in Sermant
1、slf4j 1.7.x and below use classloader to find binds of StaticLoggerBinder
2、slf4j 1.8.x and above use SPI to find SLF4JServiceProvider
both FrameworkClassLoader and PluginClassLoader should be fixed, we use PluginClassLoader to illustrate the problem
case1(Plugin use slf4j 1.7.x-): getResources will find StaticLoggerBinder bindings both in the plugin and in the host application, and the order is undefined due to the slf4j doc, so may cause plugin can not log correctly
case2(Plugin use slf4j 1.8.x+): getResources will find SLF4JServiceProvider implementations both in the plugin and in the host application, this will cause load of related classes in host application, and may cause problems
(due to privacy issue we can not post related info, but the problem is as descirbed)
How can we reproduce it (as minimally and precisely as possible)?
We expect:
Seramnt 1.x: Both FrameworkClassLoader and PluginClassLoader should be fixed as above
Sermant 2.x: PluginClassLoader missed process of StaticLoggerBinder, and should be fixed
Anything else we need to know?
We already upload the patch code to the enviroment, and found the solution works.
Sermant version
Sermant 1.2.0-1.4.1
OS version
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
# On Windows:C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
The text was updated successfully, but these errors were encountered:
What happened?
logger problems occurs when use slf4j for logging in Sermant
1、slf4j 1.7.x and below use classloader to find binds of StaticLoggerBinder
2、slf4j 1.8.x and above use SPI to find SLF4JServiceProvider
both FrameworkClassLoader and PluginClassLoader should be fixed, we use PluginClassLoader to illustrate the problem
case1(Plugin use slf4j 1.7.x-): getResources will find StaticLoggerBinder bindings both in the plugin and in the host application, and the order is undefined due to the slf4j doc, so may cause plugin can not log correctly
case2(Plugin use slf4j 1.8.x+): getResources will find SLF4JServiceProvider implementations both in the plugin and in the host application, this will cause load of related classes in host application, and may cause problems
(due to privacy issue we can not post related info, but the problem is as descirbed)
How can we reproduce it (as minimally and precisely as possible)?
This problem is already known to Sermant, and in 2.X is almost fixed. (getResources)
https://github.com/sermant-io/Sermant/blob/2.2.x/sermant-agentcore/sermant-agentcore-core/src/main/java/io/sermant/core/classloader/FrameworkClassLoader.java
We expect:
Seramnt 1.x: Both FrameworkClassLoader and PluginClassLoader should be fixed as above
Sermant 2.x: PluginClassLoader missed process of StaticLoggerBinder, and should be fixed
Anything else we need to know?
We already upload the patch code to the enviroment, and found the solution works.
Sermant version
OS version
The text was updated successfully, but these errors were encountered: