Git Product home page Git Product logo

journal's Introduction

Journal

image

Build Status Maven Central codecov

Journal is a fast, simple, Scala library for logging, based on SLF4J. It uses Logback as the default backend, but you can supply any backend you want.

Please view the documentation for more information.

journal's People

Contributors

ceedubs avatar kanterov avatar keirlawson avatar paulp avatar rossabaker avatar runarorama avatar stew avatar timperrett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

journal's Issues

Document how to use an alternative backend

Journal's README.md states that It uses Logback as the default backend, but you can supply any backend you want, however there appears to be no documentation or examples of how to supply an alternative backend (Log4j2 for example). Could such documentation be added?

Support for 2.12?

How much work is this? If I wanted to PR this in, what would I need to do?

How is the performance?

Have you done performance benchmark on the library? How's the CPU usage and throughput compared to a conventional logging library?

Update dependency in documentation

The current version on Maven central (that the badge in the README references) is for io.verizon.journal#core_2.11;2.3.15, but the documentation site still says to look for oncue.journal on bintray.

Support for Scala 2.11?

Noticed that there is support for Scala 2.11 in recent commits, but only 2.10 in released versions in Bintray.

Does that mean that 2.11 will be supported in an upcoming release fairly soon?

Fatal exceptions are not logged

This is perhaps due to the threaded/asynchronous nature of the journal library, but fatal exceptions are not logged unless they are handled specially. This issue may be more one of documentation, as a workaround exists, but it may be worth investigating whether it would be possible to deal with the problem so the workaround was not necessary.

To reproduce this issue with 2.2.1, run:

import journal._

object RapidDeath extends App {

  val log = Logger[this.type]

  try {
    throw new Exception("Oh no!")
  } catch {
    case t: Throwable => log.error("Died", t)
  }

}

No log file is written, perhaps because the application terminates (along with the logger threads) before any buffers are flushed and a message is written.

Conversely, you can ensure that the exception will be logged with:

import journal._

object RapidDeath extends App {

  val log = Logger[this.type]

  try {
    throw new Exception("Oh no!")
  } catch {
    case t: Throwable => log.backend.error("Died", t)
  }

}

Note the direct call to log.backend in the catch block. This appears to bypass the threading, ensuring the message reaches the log before the application terminates. I think this is mostly a reasonable workaround, so long as your application is sufficiently simple to have just one or two places where this specialized try/catch/log behavior is necessary, but it might merit a note in the documentation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.