https://github.com/fluent/fluent-logger-scala
A structured logger implementation in Scala.
https://github.com/fluent/fluent-logger-scala
fluentd fluentd-logger scala
Last synced: 6 months ago
JSON representation
A structured logger implementation in Scala.
- Host: GitHub
- URL: https://github.com/fluent/fluent-logger-scala
- Owner: fluent
- License: other
- Created: 2011-10-19T04:22:37.000Z (about 14 years ago)
- Default Branch: develop
- Last Pushed: 2019-07-30T08:38:52.000Z (over 6 years ago)
- Last Synced: 2025-07-04T10:19:50.618Z (6 months ago)
- Topics: fluentd, fluentd-logger, scala
- Language: Shell
- Homepage: https://github.com/fluent
- Size: 1.03 MB
- Stars: 46
- Watchers: 15
- Forks: 18
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
fluent-logger-scala [](https://travis-ci.org/fluent/fluent-logger-scala)  [](http://javadoc-badge.appspot.com/org.fluentd/fluent-logger-scala_2.12)
==========
# 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](http://github.com/fluent/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](https://github.com/fluent/fluent-logger-scala/wiki/QuickStart) to get started!
## Usage
```scala
# 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](https://github.com/fluent/fluent-logger-python)