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
Right now if the application class path does not contains a well-known logging backend (like Logback, Log4j and etc) the created logger gets fixed predefined name "com.alipay.sofa.common.log".
So if an app uses a library like SOFAJRaft and uses a not very popular Slf4j-compatible logging backend (for example, GFLog) then all logging that is produced by that library gets default logger name "com.alipay.sofa.common.log". As result, it is impossible to control logging levels of different parts of the library separately.
Example:
Loggerlog = LoggerSpaceManager.getLoggerBySpace("someLoggerSpace", "someLoggerName");
// Returns logger with name "com.alipay.sofa.common.log".// "someLoggerSpace" or "someLoggerName" are not included into the logger name at all
Your scenes
We need to control logging levels for different parts of the app separately because logs from different parts have different importance levels even if there is no logging backend known by sofa-common-tools.
Your advice
I think its necessary to modify MultiAppLoggerSpaceManager.NOP_LOGGER_FACTORY to actually take in account provided logger name instead of just defaulting to a Constants.DEFAULT_LOG:
Ideally it would be nice to also take the space into the account but for that it would be necessary to modify MultiAppLoggerSpaceManager to create new instances of AbstractLoggerSpaceFactory instead of using single NOP_LOGGER_FACTORY if no pre-defined logging backend is found.
Alternatively, it would be nice to have support of custom logging backend so it would be possible to utilize other logging backends that are not explicitly mentioned in MultiAppLoggerSpaceManager.createILoggerFactory(...)
Environment
sofa-common-tools version: 1.0.12 (transitive from jraft-core:1.3.9)
JVM version (e.g. java -version): openjdk version "11.0.13"
The text was updated successfully, but these errors were encountered:
Your question
Right now if the application class path does not contains a well-known logging backend (like Logback, Log4j and etc) the created logger gets fixed predefined name "com.alipay.sofa.common.log".
So if an app uses a library like SOFAJRaft and uses a not very popular Slf4j-compatible logging backend (for example, GFLog) then all logging that is produced by that library gets default logger name "com.alipay.sofa.common.log". As result, it is impossible to control logging levels of different parts of the library separately.
Example:
Your scenes
We need to control logging levels for different parts of the app separately because logs from different parts have different importance levels even if there is no logging backend known by sofa-common-tools.
Your advice
I think its necessary to modify
MultiAppLoggerSpaceManager.NOP_LOGGER_FACTORY
to actually take in account provided logger name instead of just defaulting to aConstants.DEFAULT_LOG
:Ideally it would be nice to also take the space into the account but for that it would be necessary to modify
MultiAppLoggerSpaceManager
to create new instances ofAbstractLoggerSpaceFactory
instead of using singleNOP_LOGGER_FACTORY
if no pre-defined logging backend is found.Alternatively, it would be nice to have support of custom logging backend so it would be possible to utilize other logging backends that are not explicitly mentioned in
MultiAppLoggerSpaceManager.createILoggerFactory(...)
Environment
jraft-core:1.3.9
)java -version
): openjdk version "11.0.13"The text was updated successfully, but these errors were encountered: