Tag 12.0-rc2
-----BEGIN PGP SIGNATURE-----

iQJFBAABCgAvFiEE4JRkoqV/9El5SKAnkrYTmhqTdH4FAl5JlFsRHGJvYXJkc0Bn
bWFpbC5jb20ACgkQkrYTmhqTdH7BYA/+P2xasCR6XKpUt9mtQW1sO0p/E2qd4Vht
4k8Mh37CW7us03jlshJxvfwMYXGpKwNMGMmgrw0TEFFNMF0YyZ/5htgCa+TH2l94
LEuYeQgSP0V1zkAImyKob0zi3uZS2vN1q74hWZr8TOGE7pgWnChaxcOMy4piA0Qz
FGv0nUFhb3ksO2CA1tylkZSyWNSgFMWnHvIPPSliH+z+4z94x9GfTHCkLFLtooCg
H679frH8mkuHv+IZWIgmtFx4T7wA18oAUGWVvolWZG43V7KAiglYZeTCJLQgNxfQ
VepppWAyA4g+Jmal/JFExscW+5wc2nL0LYB20h33o92P6zpC2RwYdo+FZ5gLxPWv
SPB3YxzvxB3mPL3YEa2iJTcaTJd49OSzuXg0r/dBgeA44Z+g8uD9W2z/LJA4gpb/
XTlMJ/q2ng3kjXebZ2gFpMzBrayLO6egfPnOrL1e/xn/frO1tzAKovDrAXzY3upi
1QKzzJZDpimzGcndoRqTFv9T1ugsbE3VMupj1E+5YlOYp+A9Hdz1omSnm2vKk8Ar
Fb+Ose9wm+qQroOU+s85StF4WpOXjGUrKIuNVp48D24OYp3Hy6ESHbmDIiKSzqd3
Op9t3LDn3krF78iD6cCADcdbQAEJ6IaU0zS8Uyp6hlKBOlUEIs4zxRrEEzmEcFLS
giI9gWHZiKI=
=ltBb
-----END PGP SIGNATURE-----
Setting version to 12.0
1 file changed
tree: ce648b9aff3015da66bb1d3f8aba9f454ddeb158
  1. .gitignore
  2. .travis.yml
  3. BUILDING.md
  4. CONTRIBUTING.md
  5. Jenkinsfile
  6. LICENSE.txt
  7. NOTICE.txt
  8. README.md
  9. build.sbt
  10. create-distributions.sh
  11. project/
  12. sample/
  13. sbt
  14. src/
  15. version.sbt
README.md

Apache Log4j 2 Scala API

Log4j Scala API is a Scala logging facade based on Log4j 2. This supports Scala 2.10, and 2.11 on Java 7 at minimum, and Scala 2.12 on Java 8 at minimum. Log4j Scala API provides Log4j 2 as its default logging implementation, but this is not strictly required (e.g., this API can also be used with Logback or other Log4j 2 API provider implementations). Idiomatic Scala features are provided as an alternative to using the Log4j 2 Java API.

Note that this Scala API was versioned and released in sync with Log4j up until version 2.8.2, but from now on it will be versioned and released independently, that's why the version was bumped to 11.0.

Jenkins Status Travis Status

Usage

SBT users can add the following dependencies to their build.sbt file:

libraryDependencies ++= Seq(
  "org.apache.logging.log4j" %% "log4j-api-scala" % "11.0",
  "org.apache.logging.log4j" % "log4j-api" % "2.11.0",
  "org.apache.logging.log4j" % "log4j-core" % "2.11.0" % Runtime
)

Basic usage of the API:

import org.apache.logging.log4j.scala.Logging
import org.apache.logging.log4j.Level
 
class MyClass extends BaseClass with Logging {
  def doStuff(): Unit = {
    logger.info("Doing stuff")
  }
  def doStuffWithLevel(level: Level): Unit = {
    logger(level, "Doing stuff with arbitrary level")
  }
  def doStuffWithUser(user: User): Unit = {
    logger.info(s"Doing stuff with ${user.getName}.")
  }
}

Documentation

The Log4j Scala API is documented in more detail in the Log4j 2 manual and in the ScalaDocs.

Requirements

Log4j Scala API requires at least Java 7 for Scala 2.10/2.11, or Java 8 for Scala 2.12. This also requires Log4j 2 API, but it is specified as transitive dependencies automatically if you are using SBT, Maven, Gradle, or some other similar build system. This also requires Log4j 2 Core (or possibly an other implementation of Log4j 2 API) as a runtime dependency. Some Log4j 2 Core features require optional dependencies which are documented in the Log4j 2 manual.

License

Apache Log4j 2 is distributed under the Apache License, version 2.0.

Download

How to download Log4j, and how to use it from SBT, Maven, Ivy and Gradle. You can access the latest development snapshot by using the Maven repository https://repository.apache.org/snapshots, see Snapshot builds.

Issue Tracking

Issues, bugs, and feature requests should be submitted to the JIRA issue tracking system for this project.

Pull request on GitHub are welcome, but please open a ticket in the JIRA issue tracker first, and mention the JIRA issue in the Pull Request.

Building From Source

Log4j Scala API requires Java 8 to build. To install to your local Maven repository, execute the following:

./sbt "+ publishM2"

Contributing

We love contributions! Take a look at our contributing page.