Git Product home page Git Product logo

fluent-logger-scala's Introduction

fluent-logger-scala Build Status Maven Central Scaladoc

Fluentd logger for Scala

Many web/mobile applications generate huge amount of event logs (c,f. login, logout, purchase, follow, etc). To analyze these event logs could be really valuable for improving the service. However, the challenge is collecting these logs easily and reliably.

Fluentd solves that problem by having: easy installation, small footprint, plugins, reliable buffering, log forwarding, etc.

fluent-logger-scala is a Scala library, to record the events from Scala application, based on fluent-logger-java. Main difference between scala and java version is to support Scala Collection.

Please see QuickStart to get started!

Usage

# For Scala 2.11 and 2.12 (Since fluent-logger-scala 0.7.0)
libraryDependencies += "org.fluentd" %% "fluent-logger-scala" % "(version)"

# For Scala 2.10 users (deprecated)
libraryDependencies += "org.fluentd" %% "fluent-logger-scala" % "0.6.0"

API

fluent-logger-scala API is based on fluent-logger-java:

FluentLoggerFactory#getLogger(tag: String): FluentLogger
FluentLoggerFactory#getLogger(tag: String, host: String, port: Int): FluentLogger
FluentLoggerFactory#getLogger(tag: String, host: String, port: Int, timeout: Int, bufferCapacity: Int): FluentLogger
FluentLoggerFactory#flushAll(): Unit
FluentLoggerFactory#closeAll(): Unit

FluentLogger#log(label: String, key: String, value: Any): Boolean
FluentLogger#log(label: String, key: String, value: Any, timestamp: Long): Boolean
FluentLogger#log(tag:String, mutableMap/immutableMap[String, Any]):Boolean
FluentLogger#flush()
FluentLogger#close()

For Developers

$ ./sbt
> compile
> test
# cross Scala version testing
> + test

Publishing to Maven Central

Describe your account information in $HOME/.sbt/(sbt-version)/sonatype.sbt file:

credentials += Credentials("Sonatype Nexus Repository Manager",
    "oss.sonatype.org",
    "(Sonatype user name)",
    "(Sonatype password)")

The release command will publish signed artifacts to the Sonatype repository, and perform releasing to Maven Central:

./sbt release

License and Copyright

  • Copyright © 2011- Tsuyoshi Ozawa and Taro L. Saito
  • Apache License, Version 2.0

Misc

This document is inspired by fluent-logger-python

fluent-logger-scala's People

Contributors

anekos avatar choplin avatar cosmo0920 avatar futoase avatar homma-takamasa avatar oza avatar repeatedly avatar xerial avatar xuwei-k avatar zaneli 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

Watchers

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

fluent-logger-scala's Issues

What happened to the master branch?

It seems that the current 'fluent-logger-scala' project uses the develop branch
as its default branch, and the master branch has not been updated since v0.6.0.

Specifically, the last update of the master branch was more than a year ago:

https://github.com/fluent/fluent-logger-scala/commits/master

Does this mean that the master branch is now deprecated?
Or is it just left behind by some mistake?

Why is this a problem?

Some external documentations assume that the master branch is the latest tip of
the project. For this reason, they are still relying on the outdated information.

For example, the official documentation still refers to the outdated CHANGELOG file,
which is still referring to v0.6.0 as the latest stable:

https://github.com/fluent/fluentd-docs/blob/master/docs/v1.0/scala.txt#L46

Shouldn't use blocking method

Currently, FluentLogger.log() method uses FutureChannel.await() function.
It blocks main program, so this should be removed.

org.fluentd.logger.sender.RawSocketSender java.net.ConnectException: Connection refused

ScalaRawSocketSender -> open() shows exceptions with stacktrace when failed to connect to server. The behavior itself seems to have no problem. However, it is confusing in production and during tests. Observed "printStackTrace" message when server refused to connect. Could we suppress it please in production code 0.7.0 versionon-wards?

Reference Code:
def open(): Unit = {
try {
connect()
} catch {
case e: IOException =>
LOG.severe(s"Failed to connect fluentd: $server")
LOG.severe("Connection will be retried")
e.printStackTrace()
close()
}
}

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.