Skip to content

Commit 6b9eaf6

Browse files
committed
Merge branch 'develop' of github.com:oza/fluent-logger-scala into develop
2 parents ad90698 + d92a6f7 commit 6b9eaf6

File tree

7 files changed

+288
-266
lines changed

7 files changed

+288
-266
lines changed

.travis.yml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
11
language: scala
22
scala:
3-
- 2.10.6
43
- 2.11.8
4+
- 2.12.1
55

66
sudo: false
77

8-
script: sbt ++$TRAVIS_SCALA_VERSION test -Dloglevel=debug
8+
script: sbt ++$TRAVIS_SCALA_VERSION test
99

1010
before_install:
11-
- rvm install 2.1.5
12-
- rvm use 2.1
13-
- gem install fluentd
11+
- rvm install 2.2.0
12+
- rvm use 2.2.0
13+
- gem install fluentd -v 0.14.11
1414

1515
jdk:
16-
- openjdk7
17-
- oraclejdk7
1816
- oraclejdk8
19-
20-
branches:
21-
only:
22-
- master
23-
- develop
24-
25-
notifications:
26-
email:
27-
28-

README.md

Lines changed: 36 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,57 @@
1-
# fluent-logger-scala -A Scala structured logger for Fluentd-
1+
fluent-logger-scala [![Build Status](https://travis-ci.org/fluent/fluent-logger-scala.svg?branch=develop)](https://travis-ci.org/fluent/fluent-logger-scala)
2+
![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.fluentd/fluent-logger-scala_2.12/badge.svg) [![Scaladoc](http://javadoc-badge.appspot.com/org.fluentd/fluent-logger-scala_2.12.svg?label=scaladoc)](http://javadoc-badge.appspot.com/org.fluentd/fluent-logger-scala_2.12)
23

3-
[![Build Status](https://travis-ci.org/fluent/fluent-logger-scala.svg?branch=develop)](https://travis-ci.org/fluent/fluent-logger-scala)
4+
====
5+
Fluentd logger for Scala
46

57
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.
68

7-
89
[Fluentd](http://github.com/fluent/fluentd) solves that problem by having: easy installation, small footprint, plugins, reliable buffering, log forwarding, etc.
910

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

1314
Please see [QuickStart](https://github.com/fluent/fluent-logger-scala/wiki/QuickStart) to get started!
1415

15-
## Installation(for scala 2.10.0 or later)
16-
17-
Add sonatype repository and dependencies to build.sbt file as follows:
18-
19-
resolvers += "Apache Maven Central Repository" at "http://repo.maven.apache.org/maven2/"
20-
21-
libraryDependencies += "org.fluentd" % "fluent-logger-scala_<scala_version>" % "0.6.0"
22-
23-
24-
Please replace ```<scala_version>``` with scala compiler version you use.
25-
Currently, ```<scala_version>``` can be replaced with 2.10 or 2.11.
26-
For instance,
27-
28-
libraryDependencies += "org.fluentd" % "fluent-logger-scala_2.10" % "0.6.0"
29-
30-
or
31-
32-
libraryDependencies += "org.fluentd" % "fluent-logger-scala_2.11" % "0.6.0"
33-
34-
## Installation(for scala 2.9)
35-
36-
We provide old version of fluent-logger-scala for scala 2.9.
37-
38-
39-
libraryDependencies += "org.fluentd" % "fluent-logger-scala_2.9.0" % "0.4.0"
16+
## Usage
4017

41-
or
18+
```scala
19+
# For Scala 2.11 and 2.12 (Since fluent-logger-scala 0.7.0)
20+
libraryDependencies += "org.fluentd" %% "fluent-logger-scala" % "(version)"
4221

43-
libraryDependencies += "org.fluentd" % "fluent-logger-scala_2.9.1" % "0.4.0"
22+
# For Scala 2.10 users (deprecated)
23+
libraryDependencies += "org.fluentd" %% "fluent-logger-scala" % "0.6.0"
24+
```
4425

45-
or
26+
### API
4627

47-
libraryDependencies += "org.fluentd" % "fluent-logger-scala_2.9.2" % "0.4.0"
28+
fluent-logger-scala API is based on fluent-logger-java:
4829

30+
```
31+
FluentLoggerFactory#getLogger(tag: String): FluentLogger
32+
FluentLoggerFactory#getLogger(tag: String, host: String, port: Int): FluentLogger
33+
FluentLoggerFactory#getLogger(tag: String, host: String, port: Int, timeout: Int, bufferCapacity: Int): FluentLogger
34+
FluentLoggerFactory#flushAll(): Unit
35+
FluentLoggerFactory#closeAll(): Unit
4936
37+
FluentLogger#log(label: String, key: String, value: Any): Boolean
38+
FluentLogger#log(label: String, key: String, value: Any, timestamp: Long): Boolean
39+
FluentLogger#log(tag:String, mutableMap/immutableMap[String, Any]):Boolean
40+
FluentLogger#flush()
41+
FluentLogger#close()
42+
```
5043

51-
## API
44+
## For Developers
5245

53-
APIs base on fluent-logger-java.
46+
```
47+
$ ./sbt
48+
> compile
49+
> test
50+
# cross Scala version testing
51+
> + test
52+
```
5453

55-
FluentLoggerFactory#getLogger(tag: String): FluentLogger
56-
FluentLoggerFactory#getLogger(tag: String, host: String, port: Int): FluentLogger
57-
FluentLoggerFactory#getLogger(tag: String, host: String, port: Int, timeout: Int, bufferCapacity: Int): FluentLogger
58-
FluentLoggerFactory#flushAll(): Unit
59-
FluentLoggerFactory#closeAll(): Unit
60-
61-
FluentLogger#log(label: String, key: String, value: Any): Boolean
62-
FluentLogger#log(label: String, key: String, value: Any, timestamp: Long): Boolean
63-
FluentLogger#log(tag:String, mutableMap/immutableMap[String, Any]):Boolean
64-
FluentLogger#flush()
65-
FluentLogger#close()
66-
67-
## How to Build from source
68-
69-
70-
## Build
71-
72-
./sbt update
73-
./sbt compile
74-
75-
## Test
76-
77-
./sbt test
78-
79-
## For developers
80-
81-
### Publishing to sonatype repository
54+
### Publishing to Maven Central
8255

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

@@ -87,16 +60,9 @@ Describe your account information in $HOME/.sbt/(sbt-version)/sonatype.sbt file:
8760
"(Sonatype user name)",
8861
"(Sonatype password)")
8962

90-
Then publish a signed artifact to the Sonatype repository:
91-
92-
./sbt publishSigned
93-
94-
Make sure you are using a release version in build.sbt file. A SNAPSHOT version is deployed to the snapshot repostitory of Sonatype, which is not synched with Maven central.
95-
96-
After publishing, you can close, promote and drop the published repositorty with sonatypeRelease command:
97-
98-
./sbt sonatypeRelease
63+
The release command will publish signed artifacts to the Sonatype repository, and perform releasing to Maven Central:
9964

65+
./sbt release
10066

10167
## License and Copyright
10268

build.sbt

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,38 @@
1-
organization := "org.fluentd"
1+
import ReleaseTransformations._
22

3+
organization := "org.fluentd"
34
name := "fluent-logger-scala"
45

5-
version := "0.6.1-SNAPSHOT"
6-
76
publishMavenStyle := true
8-
9-
scalaVersion := "2.11.8"
10-
11-
crossScalaVersions := Seq("2.10.6", scalaVersion.value)
12-
13-
resolvers ++= Seq(
14-
"Sonatype Repository" at "http://oss.sonatype.org/content/repositories/releases"
15-
)
16-
7+
scalaVersion := "2.12.1"
8+
crossScalaVersions := Seq("2.11.8", scalaVersion.value)
179
scalacOptions ++= Seq("-deprecation", "-feature", "-language:implicitConversions")
18-
1910
logBuffered in Test := false
20-
2111
libraryDependencies ++= Seq(
2212
"org.fluentd" % "fluent-logger" % "0.3.2",
23-
"org.json4s" %% "json4s-native" % "3.4.0",
13+
"org.json4s" %% "json4s-native" % "3.5.0",
2414
"junit" % "junit" % "4.12" % Test,
25-
"org.xerial" % "fluentd-standalone" % "0.1.2" % Test,
26-
"org.scalatest" %% "scalatest" % "3.0.0" % Test
15+
"org.xerial" %% "fluentd-standalone" % "0.14.11" % Test,
16+
"org.scalatest" %% "scalatest" % "3.0.1" % Test
17+
)
18+
19+
// Release settings
20+
releaseTagName := { (version in ThisBuild).value }
21+
releaseProcess := Seq[ReleaseStep](
22+
checkSnapshotDependencies,
23+
inquireVersions,
24+
runClean,
25+
runTest,
26+
setReleaseVersion,
27+
commitReleaseVersion,
28+
tagRelease,
29+
ReleaseStep(action = Command.process("publishSigned", _), enableCrossBuild = true),
30+
setNextVersion,
31+
commitNextVersion,
32+
ReleaseStep(action = Command.process("sonatypeReleaseAll", _), enableCrossBuild = true),
33+
pushChanges
2734
)
35+
releaseCrossBuild := true
2836

2937
pomExtra := (
3038
<url>https://github.com/fluent/fluent-logger-scala</url>

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.12
1+
sbt.version=0.13.13

project/plugin.sbt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
2-
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0")
3-
4-
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "0.5.1")
5-
1+
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.3")
2+
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1")
63
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
7-
4+
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-M15")
85
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.7.5")
96

107
scalacOptions ++= Seq("-deprecation", "-feature")

0 commit comments

Comments
 (0)