tuscany-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Sebastien Delfino <jsdelf...@apache.org>
Subject Re: Logging component example
Date Wed, 02 Jun 2010 04:21:25 GMT
Jean-Sebastien Delfino wrote:
> ant elder wrote:
>> On Tue, May 25, 2010 at 7:17 AM, Jean-Sebastien Delfino
>> <jsdelfino@apache.org> wrote:
>>> Hi,
>>>
>>> I'd like to contribute an example of a logging component for Tuscany 
>>> Java
>>> using a logging tool like Scribe [1].
>>>
>>> I've played around with a similar component for Tuscany C++ and found 
>>> that
>>> Scribe works and scales really well.
>>>
>>> Then in a second step I'd like to investigate how to hook it up with the
>>> logging policy (as a variation of the current logging policy).
>>>
>>> If there's no objection I'll start to work on that in the next few days.
>>>
>>> [1] http://github.com/facebook/scribe
>>> -- 
>>> Jean-Sebastien
>>>
>>
>> I like the idea of having a collection of useful components available
>> in Tuscany for users. I did have a quick look at scribe, but from that
>> admittedly very quick look its not totally clear what it is - some
>> sort of distributed logging thing using in C++ and/or Python?
> 
> Scribe is a logging server written in C++ using Apache Thrift [2]. Logs 
> can be written locally (with configuration of how the logs are stored, 
> rotated etc) or streamed to remote Scribe servers over a network (useful 
> to aggregate logs from distributed apps).
> 
> To log something you give Scribe a category and a log string. The 
> category can be used to organize how the logs are stored.
> 
> More info on the Scribe wiki [3].
> 
> Would
>> you say a bit more about how that would that fit in with the Java
>> runtime and how an SCA component using it would be used?
>>
> 
> Scribe uses Apache Thrift, which supports pure Java clients [4][5].
> 
> I'm thinking that the sample logging component (written in Java) can 
> have a simple int log(String category, String message) method and two or 
> three properties to configure the Scribe server location.
> 
> Then from an app, declare a reference, wire it to the logging component, 
> and call ref.log("foo", "Hey there").
> 
> It would be nice to also have a Scribe-based logging policy similar to 
> modules/policy-logging but that'll be more work, probably more than I 
> can do with my limited time.
> 
> I'm planning to find a couple hours during the long weekend to play more 
> with this, and come up with a strawman in samples/logging-scribe.
> 
> Hope this helps
> 
> [2] http://incubator.apache.org/thrift/
> [3] http://wiki.github.com/facebook/scribe/
> [4] http://wiki.apache.org/thrift/ThriftUsageJava
> [5] http://jnb.ociweb.com/jnb/jnbJun2009.html

I've committed an initial version of the Scribe logging sample [6]. The 
README describes how to build and test it.

[6] 
http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/logging-scribe
-- 
Jean-Sebastien

Mime
View raw message