AVSL is a very simple logger, written in Scala. AVSL implements the Simple Logging Facade for Java (SLF4J) API, allowing applications to be written to the SLF4J API. (This, of course, includes Java applications.) Because it implements SLF4J, AVSL can easily be swapped for another SLF4J-compatible logging framework (or the other way around), without any changes to the calling application. Also, because it supports SLF4J, AVSL can be used in conjunction with Scala SLF4J wrappers, such as Grizzled-SLF4J.
“AVSL” stands for “A Very Simple Logger”, and AVSL strives for simplicity in several ways.
- AVSL is simple to configure, using a non-XML, INI-style configuration file that’s reminiscent of the Python logging module’s configuration. This simpler configuration file is easier to read and edit than the XML configuration files used by logging frameworks such as Logback. (Since I dislike XML configuration files, this is big win for me.)
- AVSL is a lightweight logging framework. It is intended to be used primarily in standalone programs, not enterprise applications. It may work fine for your enterprise application, of course; but, if it doesn’t, you can easily switch to something else.
- The default message formatter uses a simpler, more compact syntax than
SimpleDateFormat, relying on
- You can specify the configuration file via an environment variable
AVSL_CONFIG) or a Java system property. If neither is present, AVSL looks for resource
avsl.confsomewhere in the classpath.
- The built-in logging handlers are thread-safe.
- AVSL does not monitor and reload its configuration file.
- AVSL does not implement the SLF4J marker or MDC capabilities.
- AVSL does not wrap other logging frameworks.
- AVSL does not let programmers define their own log levels.
In short, AVSL is a perfectly serviceable, simple logging framework that can easily be swapped out for something with more features.
sync’d with the Maven Central Repository.
- Version 1.0.12 supports Scala 2.10, 2.11 and 2.12.0-final.
- Version 1.0.11 supports Scala 2.10, 2.11 and 2.12.0-M5
- Version 1.0.9 and 1.1.10 support Scala 2.10, 2.11 and 2.12.0-M4
- Versions 1.0.1 through 1.0.8 supports Scala 2.10
- Version 1.0 supports Scala 2.10.0-M7
- Version 0.4 supports Scala 2.9.2, 2.9.1-1, 2.9.1, 2.9.0-1, 2.9.0, 2.8.2, 2.8.1 and 2.8.0.
Installing for Maven
If you’re using Maven, just give it the artifact, and Maven will do the rest:
- Group ID:
- Artifact ID:
<dependency> <groupId>org.clapper</groupId> <artifactId>avsl_2.11</artifactId> <version>1.0.12</version> </dependency>
For more information on using Maven and Scala, see Josh Suereth’s Scala Maven Guide.
Using with SBT
Add the following to your SBT build:
libraryDependencies += "org.clapper" %% "avsl" % "1.0.12"
Source Code Repository
The source code for AVSL is maintained on GitHub. To clone the repository, run this command:
$ git clone git://github.com/bmc/avsl.git
Building from Source
Building the library requires SBT 0.13.x, but you don’t need to download it, as the repo has a copy of Lightbend Activator. To build, just run:
bin/activator +compile +test +package
The resulting jar file will be in the top-level
Please consult the User’s Guide for details on how to use and configure AVSL.
The change log for all releases is here.
Brian M. Clapper, email@example.com
Copyright and License
AVSL is copyright © 2010-2014 Brian M. Clapper and is released under a BSD License.
I gladly accept patches from their original authors. Feel free to email patches to me or to fork the GitHub repository and send me a pull request. Along with any patch you send:
- Please state that the patch is your original work.
- Please indicate that you license the work to the AVSL project under a BSD License.