From 83e5d89fccffbca906dd8363aac5dd09fa066ab6 Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Tue, 24 Sep 2024 13:49:22 -0700 Subject: [PATCH] Upgrade logback-core to 1.5.8 (#3648) SizeAndTimeBasedFNATP of logback-core was deprecated 8 years ago. This fix will remove its usage https://github.com/qos-ch/logback/blame/42caff87ae6eb553dcbf77e25ba87a9d340357ee/logback-core/src/main/java/ch/qos/logback/core/CoreConstants.java#L240 --- .../src/main/scala/wvlet/log/LogRotationHandler.scala | 9 ++++++--- airspec/build.sbt | 2 +- build.sbt | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/airframe-log/.jvm/src/main/scala/wvlet/log/LogRotationHandler.scala b/airframe-log/.jvm/src/main/scala/wvlet/log/LogRotationHandler.scala index 30ba1789ff..82eb077e07 100644 --- a/airframe-log/.jvm/src/main/scala/wvlet/log/LogRotationHandler.scala +++ b/airframe-log/.jvm/src/main/scala/wvlet/log/LogRotationHandler.scala @@ -17,10 +17,13 @@ import java.io.{File, Flushable} import java.nio.charset.StandardCharsets import java.util.logging.ErrorManager import java.util.{logging => jl} - import ch.qos.logback.core.ContextBase import ch.qos.logback.core.encoder.EncoderBase -import ch.qos.logback.core.rolling.{RollingFileAppender, SizeAndTimeBasedFNATP, TimeBasedRollingPolicy} +import ch.qos.logback.core.rolling.{ + RollingFileAppender, + SizeAndTimeBasedFileNamingAndTriggeringPolicy, + TimeBasedRollingPolicy +} import ch.qos.logback.core.util.FileSize import wvlet.log.LogFormatter.AppLogFormatter @@ -78,7 +81,7 @@ class LogRotationHandler( val fileAppender = new RollingFileAppender[String]() val rollingPolicy = new TimeBasedRollingPolicy[String] - val triggeringPolicy = new SizeAndTimeBasedFNATP[String] + val triggeringPolicy = new SizeAndTimeBasedFileNamingAndTriggeringPolicy[String] rollingPolicy.setContext(context) val fileNameStem = diff --git a/airspec/build.sbt b/airspec/build.sbt index d854634421..d7ad463b42 100644 --- a/airspec/build.sbt +++ b/airspec/build.sbt @@ -228,7 +228,7 @@ lazy val airspecLog = airspecJVMBuildSettings, libraryDependencies ++= Seq( // For rotating log files - "ch.qos.logback" % "logback-core" % "1.3.14" + "ch.qos.logback" % "logback-core" % "1.5.8" ) ) .jsSettings( diff --git a/build.sbt b/build.sbt index 5fc686ad4e..42e0099bbb 100644 --- a/build.sbt +++ b/build.sbt @@ -600,7 +600,7 @@ val logDependencies = { scalaVersion: String => val logJVMDependencies = Seq( // For rotating log files - "ch.qos.logback" % "logback-core" % "1.3.14" + "ch.qos.logback" % "logback-core" % "1.5.8" ) // airframe-log should have minimum dependencies