-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move Configurator interface to logback-core, add support for configur…
…ation from a serialized model ,smo file Signed-off-by: Ceki Gulcu <ceki@qos.ch>
- Loading branch information
Showing
28 changed files
with
928 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
logback-access/src/main/java/ch/qos/logback/access/joran/ModelClassToModelHandlerLinker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Logback: the reliable, generic, fast and flexible logging framework. | ||
* Copyright (C) 1999-2023, QOS.ch. All rights reserved. | ||
* | ||
* This program and the accompanying materials are dual-licensed under | ||
* either the terms of the Eclipse Public License v1.0 as published by | ||
* the Eclipse Foundation | ||
* | ||
* or (per the licensee's choosing) | ||
* | ||
* under the terms of the GNU Lesser General Public License version 2.1 | ||
* as published by the Free Software Foundation. | ||
*/ | ||
|
||
package ch.qos.logback.access.joran; | ||
|
||
import ch.qos.logback.access.model.ConfigurationModel; | ||
import ch.qos.logback.access.model.processor.ConfigurationModelHandler; | ||
import ch.qos.logback.core.Context; | ||
import ch.qos.logback.core.joran.ModelClassToModelHandlerLinkerBase; | ||
import ch.qos.logback.core.model.AppenderModel; | ||
import ch.qos.logback.core.model.AppenderRefModel; | ||
import ch.qos.logback.core.model.processor.AppenderModelHandler; | ||
import ch.qos.logback.core.model.processor.AppenderRefDependencyAnalyser; | ||
import ch.qos.logback.core.model.processor.AppenderRefModelHandler; | ||
import ch.qos.logback.core.model.processor.DefaultProcessor; | ||
import ch.qos.logback.core.model.processor.RefContainerDependencyAnalyser; | ||
|
||
/** | ||
* For a given DefaultProcessor instance link a {@link ch.qos.logback.core.model.Model Model} class to a | ||
* {@link ch.qos.logback.core.model.processor.ModelHandlerBase ModelHandler} instance | ||
* for logback-access. | ||
* | ||
* <p>Will also use links from super class.</p> | ||
* | ||
* @since 1.3.9/1.4.9 | ||
*/ | ||
public class ModelClassToModelHandlerLinker extends ModelClassToModelHandlerLinkerBase { | ||
|
||
public ModelClassToModelHandlerLinker(Context context) { | ||
super(context); | ||
} | ||
|
||
public void link(DefaultProcessor defaultProcessor) { | ||
super.link(defaultProcessor); | ||
defaultProcessor.addHandler(ConfigurationModel.class, ConfigurationModelHandler::makeInstance); | ||
defaultProcessor.addHandler(AppenderModel.class, AppenderModelHandler::makeInstance); | ||
defaultProcessor.addHandler(AppenderRefModel.class, AppenderRefModelHandler::makeInstance); | ||
|
||
defaultProcessor.addAnalyser(AppenderModel.class, | ||
() -> new RefContainerDependencyAnalyser(context, AppenderModel.class)); | ||
defaultProcessor.addAnalyser(AppenderRefModel.class, () -> new AppenderRefDependencyAnalyser(context)); | ||
|
||
sealModelFilters(defaultProcessor); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
...ck-classic/src/main/java/ch/qos/logback/classic/joran/ModelClassToModelHandlerLinker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
* Logback: the reliable, generic, fast and flexible logging framework. | ||
* Copyright (C) 1999-2023, QOS.ch. All rights reserved. | ||
* | ||
* This program and the accompanying materials are dual-licensed under | ||
* either the terms of the Eclipse Public License v1.0 as published by | ||
* the Eclipse Foundation | ||
* | ||
* or (per the licensee's choosing) | ||
* | ||
* under the terms of the GNU Lesser General Public License version 2.1 | ||
* as published by the Free Software Foundation. | ||
*/ | ||
|
||
package ch.qos.logback.classic.joran; | ||
|
||
import ch.qos.logback.classic.model.ConfigurationModel; | ||
import ch.qos.logback.classic.model.ContextNameModel; | ||
import ch.qos.logback.classic.model.LevelModel; | ||
import ch.qos.logback.classic.model.LoggerContextListenerModel; | ||
import ch.qos.logback.classic.model.LoggerModel; | ||
import ch.qos.logback.classic.model.RootLoggerModel; | ||
import ch.qos.logback.classic.model.processor.ConfigurationModelHandler; | ||
import ch.qos.logback.classic.model.processor.ContextNameModelHandler; | ||
import ch.qos.logback.classic.model.processor.LevelModelHandler; | ||
import ch.qos.logback.classic.model.processor.LoggerContextListenerModelHandler; | ||
import ch.qos.logback.classic.model.processor.LoggerModelHandler; | ||
import ch.qos.logback.classic.model.processor.RootLoggerModelHandler; | ||
import ch.qos.logback.core.Context; | ||
import ch.qos.logback.core.joran.ModelClassToModelHandlerLinkerBase; | ||
import ch.qos.logback.core.model.AppenderModel; | ||
import ch.qos.logback.core.model.AppenderRefModel; | ||
import ch.qos.logback.core.model.InsertFromJNDIModel; | ||
import ch.qos.logback.core.model.processor.AppenderModelHandler; | ||
import ch.qos.logback.core.model.processor.AppenderRefDependencyAnalyser; | ||
import ch.qos.logback.core.model.processor.AppenderRefModelHandler; | ||
import ch.qos.logback.core.model.processor.DefaultProcessor; | ||
import ch.qos.logback.core.model.processor.InsertFromJNDIModelHandler; | ||
import ch.qos.logback.core.model.processor.RefContainerDependencyAnalyser; | ||
|
||
/** | ||
* For a given DefaultProcessor instance link a {@link ch.qos.logback.core.model.Model Model} class to a | ||
* {@link ch.qos.logback.core.model.processor.ModelHandlerBase ModelHandler} instance for | ||
* logback-classic. | ||
* | ||
* <p>Will also use links from super class.</p> | ||
* | ||
* @since 1.3.9/1.4.9 | ||
*/ | ||
public class ModelClassToModelHandlerLinker extends ModelClassToModelHandlerLinkerBase { | ||
|
||
public ModelClassToModelHandlerLinker(Context context) { | ||
super(context); | ||
} | ||
|
||
@Override | ||
public void link(DefaultProcessor defaultProcessor) { | ||
super.link(defaultProcessor); | ||
defaultProcessor.addHandler(ConfigurationModel.class, ConfigurationModelHandler::makeInstance); | ||
defaultProcessor.addHandler(ContextNameModel.class, ContextNameModelHandler::makeInstance); | ||
defaultProcessor.addHandler(LoggerContextListenerModel.class, LoggerContextListenerModelHandler::makeInstance); | ||
|
||
defaultProcessor.addHandler(InsertFromJNDIModel.class, InsertFromJNDIModelHandler::makeInstance); | ||
|
||
defaultProcessor.addHandler(AppenderModel.class, AppenderModelHandler::makeInstance); | ||
defaultProcessor.addHandler(AppenderRefModel.class, AppenderRefModelHandler::makeInstance); | ||
defaultProcessor.addHandler(RootLoggerModel.class, RootLoggerModelHandler::makeInstance); | ||
defaultProcessor.addHandler(LoggerModel.class, LoggerModelHandler::makeInstance); | ||
defaultProcessor.addHandler(LevelModel.class, LevelModelHandler::makeInstance); | ||
|
||
defaultProcessor.addAnalyser(LoggerModel.class, | ||
() -> new RefContainerDependencyAnalyser(context, LoggerModel.class)); | ||
|
||
defaultProcessor.addAnalyser(RootLoggerModel.class, | ||
() -> new RefContainerDependencyAnalyser(context, RootLoggerModel.class)); | ||
|
||
defaultProcessor.addAnalyser(AppenderModel.class, | ||
() -> new RefContainerDependencyAnalyser(context, AppenderModel.class)); | ||
|
||
defaultProcessor.addAnalyser(AppenderRefModel.class, () -> new AppenderRefDependencyAnalyser(context)); | ||
|
||
sealModelFilters(defaultProcessor); | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.