summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/samples/learning-more/logging-scribe/helloworld-scribe/README
blob: 92f339ead5d505f7e08c7bbc09423b03526b8b19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
This Tuscany sample shows how to implement and use a simple Logger component
that logs string messages to a Scribe logging server.

Scribe is an Open Source server for aggregating streaming log data. It is
designed to scale to a very large number of nodes and be robust to network
and node failures.

See the Scribe Wiki [1] for more information on Scribe.

Getting the required Apache Thrift library
==========================================
This sample uses Apache Thrift's libthrift.jar to communicate with Scribe
servers. Libthrift is not yet available in a Maven repository, so before
building the sample with Maven, you need to download libthrift [2] and
install it in your local Maven repository like this:

mvn install:install-file -DgroupId=org.apache.thrift -DartifactId=libthrift \
-Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=libthrift-r917130.jar

Starting a Scribe server
========================
Before running the LoggingTest sample test program, you need to start a Scribe
server for the sample program to connect to.

Steps to start a Scribe server are described in the Scribe examples README [3].
A simple Scribe server configuration can be found in the Scribe examples [4].

LoggingTest will try to connect to a Scribe server at localhost:1463. To use
a Scribe server at a different host or port, configure the host and port
properties in scribe.composite to match your server.

Running the LoggingTest sample test program
===========================================

To run the LoggingTest sample test program, do this:
mvn -Dtest=LoggingTest test

Checking the Scribe log output
==============================
After running LoggingTest, you should find the logged string "Hello There" in
file sample/sample_current under your Scribe log store directory.

If you've used the example1.conf Scribe configuration from the Scribe examples
[4], you should find your log message in /tmp/scribetest/sample/sample_current.


[1] http://wiki.github.com/facebook/scribe/
[2] http://svn.apache.org/repos/asf/cassandra/trunk/lib/libthrift-r917130.jar
[3] http://github.com/facebook/scribe/blob/master/examples/README
[4] http://github.com/facebook/scribe/blob/master/examples/example1.conf