Skip to content

Commit

Permalink
twitter-server/slf4j-log4j12: Mark deprecated
Browse files Browse the repository at this point in the history
Problem

Log4j 1.x was EOL in 2015. It is time to drop support for the
logging framework from TwitterServer.

Solution

Mark the BUILD targets and the LoggingHandler as deprecated with
the intention to remove. Users are encouraged to use Logback as
a replacement.

Differential Revision: https://phabricator.twitter.biz/D812006
  • Loading branch information
cacoco authored and jenkins committed Jan 12, 2022
1 parent cbc7383 commit 2e213f7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions slf4j-log4j12/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TwitterServer `slf4j-log4j12`
============================
[DEPRECATED] TwitterServer `slf4j-log4j12`
==========================================

This library provides a wrapper over the [`slf4j-log4j12`](https://www.slf4j.org/manual.html#swapping) logging
implementation for use in `TwitterServer` along with the appropriate [SLF4J bridges](https://www.slf4j.org/legacy.html)
Expand Down
5 changes: 4 additions & 1 deletion slf4j-log4j12/src/main/resources/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ resources(
"!BUILD*",
"**/*",
],
tags = ["bazel-compatible"],
tags = [
"bazel-compatible",
"deprecated", # Users are encouraged to use twitter-server/logback-classic instead
],
)
1 change: 1 addition & 0 deletions slf4j-log4j12/src/main/scala/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ scala_library(
scope = "forced", # Exposes a service-loaded class.
tags = [
"bazel-compatible",
"deprecated", # Users are encouraged to use twitter-server/logback-classic instead
"logging_impl_check_whitelisted_target",
],
dependencies = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ import com.twitter.server.util.HttpUtils._
import com.twitter.util.Future
import com.twitter.util.logging.Logging
import java.net.URLEncoder
import org.apache.log4j.{Level, LogManager, Logger}
import org.apache.log4j.Level
import org.apache.log4j.LogManager
import org.apache.log4j.Logger
import scala.collection.JavaConverters._

@deprecated("Users are encouraged to use twitter-server/logback-classic.", "2022-01-12")
private class LoggingHandler extends com.twitter.server.handler.LoggingHandler with Logging {

/** Implementation name */
Expand Down

0 comments on commit 2e213f7

Please sign in to comment.