This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
arklet场景下使用logback组件存在冲突导致应用启动失败 #358
Comments
从代码中可以看到 LogbackReInitializer支持reinit private boolean innerCheckForFileNamePatternCollisionInPreviousRFA(FileNamePattern fileNamePattern) {
boolean collisionsDetected = false;
@SuppressWarnings("unchecked")
Map<String, FileNamePattern> map = (Map<String, FileNamePattern>) context.getObject(CoreConstants.RFA_FILENAME_PATTERN_COLLISION_MAP);
if (map == null) {
return collisionsDetected;
}
for (Entry<String, FileNamePattern> entry : map.entrySet()) {
if (fileNamePattern.equals(entry.getValue())) {
addErrorForCollision("FileNamePattern", entry.getValue().toString(), entry.getKey());
collisionsDetected = true;
}
}
if (name != null) {
map.put(getName(), fileNamePattern);
}
return collisionsDetected;
} |
可以看到实际可以通过更换 /**
* FOR INTERNAL USE. This method is intended for use by StaticLoggerBinder.
*
* @param defaultLoggerContext
* @throws ClassNotFoundException
* @throws NoSuchMethodException
* @throws InstantiationException
* @throws IllegalAccessException
* @throws InvocationTargetException
*/
public void init(LoggerContext defaultLoggerContext, Object key) throws ClassNotFoundException, NoSuchMethodException, InstantiationException,
IllegalAccessException, InvocationTargetException {
if (this.key == null) {
this.key = key;
} else if (this.key != key) {
throw new IllegalAccessException("Only certain classes can access this method.");
}
String contextSelectorStr = OptionHelper.getSystemProperty(ClassicConstants.LOGBACK_CONTEXT_SELECTOR);
if (contextSelectorStr == null) {
contextSelector = new DefaultContextSelector(defaultLoggerContext);
} else if (contextSelectorStr.equals("JNDI")) {
// if jndi is specified, let's use the appropriate class
contextSelector = new ContextJNDISelector(defaultLoggerContext);
} else {
contextSelector = dynamicalContextSelector(defaultLoggerContext, contextSelectorStr);
}
} |
目前看到已经有pr在跟进了 |
Merged
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the question or bug
ark-serverless 0.5.5 之后支持了arklet并行加速静态发布 #324
当biz使用logback组件时出现logback冲突
导致biz启动失败
Expected behavior
biz正常启动
Actual behavior
部分biz会报错
Steps to reproduce
Steps to reproduce the problem:
Screenshots
If applicable, add screenshots to help explain your problem.
Minimal yet complete reproducer code (or GitHub URL to code)
Environment
java -version
):uname -a
):The text was updated successfully, but these errors were encountered: