Skip to content

Commit 80db86b

Browse files
committed
fix issues/860
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
1 parent a8a2303 commit 80db86b

File tree

3 files changed

+48
-2
lines changed

3 files changed

+48
-2
lines changed

logback-core/src/main/java/ch/qos/logback/core/CoreConstants.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ public class CoreConstants {
250250
public static final int UNBOUND_HISTORY = UNBOUNDED_HISTORY;
251251

252252
//public static final String RECONFIGURE_ON_CHANGE_TASK = "RECONFIGURE_ON_CHANGE_TASK";
253-
public static final String SIZE_AND_TIME_BASED_FNATP_IS_DEPRECATED = "SizeAndTimeBasedFileNamingAndTriggeringPolicy is deprecated. Use SizeAndTimeBasedRollingPolicy instead";
253+
public static final String SIZE_AND_TIME_BASED_FNATP_IS_DEPRECATED = "Direct use of either SizeAndTimeBasedFNATP or SizeAndTimeBasedFileNamingAndTriggeringPolicy ";
254+
public static final String SIZE_AND_TIME_BASED_FNATP_IS_DEPRECATED_BIS = "is deprecated. Please use SizeAndTimeBasedRollingPolicy instead.";
254255

255256
public static final char JSON_LINE_SEPARATOR = '\n';
256257
final public static String MODEL_CONFIG_FILE_EXTENSION = ".scmo";
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Logback: the reliable, generic, fast and flexible logging framework.
3+
* Copyright (C) 1999-2024, QOS.ch. All rights reserved.
4+
*
5+
* This program and the accompanying materials are dual-licensed under
6+
* either the terms of the Eclipse Public License v1.0 as published by
7+
* the Eclipse Foundation
8+
*
9+
* or (per the licensee's choosing)
10+
*
11+
* under the terms of the GNU Lesser General Public License version 2.1
12+
* as published by the Free Software Foundation.
13+
*/
14+
15+
package ch.qos.logback.core.rolling;
16+
17+
import static ch.qos.logback.core.CoreConstants.MANUAL_URL_PREFIX;
18+
19+
/**
20+
* <p>{@link SizeAndTimeBasedFNATP} class was renamed as {@link SizeAndTimeBasedFileNamingAndTriggeringPolicy}
21+
* in version 1.5.8. In version 1.5.16 it was reintroduced to preserve backward compatibility with existing
22+
* configurations.</p>
23+
*
24+
*
25+
*
26+
* @since removed in 1.5.8 and reintroduced in 1.5.16
27+
*/
28+
29+
public class SizeAndTimeBasedFNATP<E> extends SizeAndTimeBasedFileNamingAndTriggeringPolicy<E> {
30+
31+
32+
@Override
33+
public void start() {
34+
addWarn("SizeAndTimeBasedFNATP class was renamed as SizeAndTimeBasedFileNamingAndTriggeringPolicy.");
35+
super.start();
36+
}
37+
38+
39+
}

logback-core/src/main/java/ch/qos/logback/core/rolling/SizeAndTimeBasedFileNamingAndTriggeringPolicy.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,16 @@
2828
/**
2929
* This class implement {@link TimeBasedFileNamingAndTriggeringPolicy}
3030
* interface extending {@link TimeBasedFileNamingAndTriggeringPolicyBase}. This class is intended to be nested
31-
* within a {@link SizeAndTimeBasedFileNamingAndTriggeringPolicy} instance. However, it can also be instantiated directly for testing purposes.
31+
* within a {@link SizeAndTimeBasedFileNamingAndTriggeringPolicy} instance. However, it can also be
32+
* instantiated directly for testing purposes.
33+
*
34+
* <p>{@link SizeAndTimeBasedFNATP} class was renamed as {@link SizeAndTimeBasedFileNamingAndTriggeringPolicy}
35+
* in version 1.5.8.</p>
3236
*
3337
* @author Ceki G&uuml;lc&uuml;
3438
*
3539
* @param <E>
40+
* @since 1.5.8
3641
*/
3742
@NoAutoStart
3843
public class SizeAndTimeBasedFileNamingAndTriggeringPolicy<E> extends TimeBasedFileNamingAndTriggeringPolicyBase<E> {
@@ -72,6 +77,7 @@ public void start() {
7277

7378
if (usage == Usage.DIRECT) {
7479
addWarn(CoreConstants.SIZE_AND_TIME_BASED_FNATP_IS_DEPRECATED);
80+
addWarn(CoreConstants.SIZE_AND_TIME_BASED_FNATP_IS_DEPRECATED_BIS);
7581
addWarn("For more information see " + MANUAL_URL_PREFIX + "appenders.html#SizeAndTimeBasedRollingPolicy");
7682
}
7783

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy