-
-
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.
add warning about the deprecation of SerializedModelConfigurator if a…
…ctivated Signed-off-by: Ceki Gulcu <ceki@qos.ch>
- Loading branch information
Showing
4 changed files
with
115 additions
and
0 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
Empty file.
69 changes: 69 additions & 0 deletions
69
.../src/test/java/ch/qos/logback/classic/issue/github450/Issues450LoggerContextListener.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,69 @@ | ||
/* | ||
* Logback: the reliable, generic, fast and flexible logging framework. | ||
* Copyright (C) 1999-2025, 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.issue.github450; | ||
|
||
import ch.qos.logback.classic.Level; | ||
import ch.qos.logback.classic.Logger; | ||
import ch.qos.logback.classic.LoggerContext; | ||
import ch.qos.logback.classic.spi.LoggerContextListener; | ||
import ch.qos.logback.core.spi.ContextAwareBase; | ||
import ch.qos.logback.core.spi.LifeCycle; | ||
import org.slf4j.MDC; | ||
|
||
public class Issues450LoggerContextListener extends ContextAwareBase implements LoggerContextListener, LifeCycle { | ||
|
||
boolean started = false; | ||
|
||
@Override | ||
public void start() { | ||
MDC.put("issues450", "12"); | ||
started = true; | ||
} | ||
|
||
@Override | ||
public void stop() { | ||
started = false; | ||
} | ||
|
||
@Override | ||
public boolean isStarted() { | ||
return started; | ||
} | ||
|
||
@Override | ||
public boolean isResetResistant() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void onStart(LoggerContext context) { | ||
|
||
} | ||
|
||
@Override | ||
public void onReset(LoggerContext context) { | ||
|
||
} | ||
|
||
@Override | ||
public void onStop(LoggerContext context) { | ||
|
||
} | ||
|
||
@Override | ||
public void onLevelChange(Logger logger, Level level) { | ||
} | ||
|
||
} |
45 changes: 45 additions & 0 deletions
45
logback-classic/src/test/java/ch/qos/logback/classic/issue/github450/SLF4JIssue450Test.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,45 @@ | ||
/* | ||
* Logback: the reliable, generic, fast and flexible logging framework. | ||
* Copyright (C) 1999-2025, 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.issue.github450; | ||
|
||
import ch.qos.logback.classic.ClassicConstants; | ||
import ch.qos.logback.classic.ClassicTestConstants; | ||
import ch.qos.logback.classic.spi.ILoggingEvent; | ||
import ch.qos.logback.classic.spi.LoggingEvent; | ||
import ch.qos.logback.core.CoreConstants; | ||
import ch.qos.logback.core.read.ListAppender; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.slf4j.MDC; | ||
|
||
public class Main { | ||
|
||
public static void main(String[] args) { | ||
System.setProperty(ClassicConstants.CONFIG_FILE_PROPERTY, "logback-classic/"+ClassicTestConstants.INPUT_PREFIX + "issue/gh_issues_450.xml"); | ||
System.setProperty(CoreConstants.STATUS_LISTENER_CLASS_KEY, "stdout"); | ||
Logger logger = LoggerFactory.getLogger(Main.class); | ||
logger.info("toto"); | ||
ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); | ||
|
||
ListAppender listAppender = (ListAppender) root.getAppender("LIST"); | ||
|
||
LoggingEvent le0 = (LoggingEvent) listAppender.list.get(0); | ||
|
||
String val = le0.getMDCPropertyMap().get("issues450"); | ||
if(val == null) { | ||
throw new RuntimeException("issues450 missing property: issues450"); | ||
} | ||
} | ||
} |