We've been working on that in Fabric.  It's currently a bit difficult to
extract as it relies on fabric being used.
Here is the code:

https://github.com/jboss-fuse/fuse/blob/master/insight/insight-log-storage/src/main/java/org/fusesource/insight/log/storage/InsightLogAppender.java

It's simply using the pax logging api to create an appender and generate
the json object which is sent to a Storage interface.
The elastic search implementation of the storage is available at

https://github.com/jboss-fuse/fuse/blob/master/insight/insight-elasticsearch/src/main/java/org/fusesource/insight/elasticsearch/impl/ElasticStorageImpl.java




2013/5/23 Niels <[email protected]>

> Hey,
>
> my goal: index my logs based on the camelContextId in ElasticSearch.
>
> During my first attempt I tried a custom LogAppender in combination with
> Sift appender.
> Separating the logs based on my CamelContextID was pretty straight forward
> when I used a simple FileAppender.
> However when trying to use my custom ElasticSearch Appender.
> I ran into the issue that I needed to include a lot of dependencies in the
> startup.properties file and supply them manually in the system directory.
>
> Attempt 2 now I'm creating a custom LogListener and registered it with the
> default exported LogReaderService of ServiceMix. But when investigating the
> LogEntry object I couldn't find a reference to the MDC Properties like the
> Sift appender did.
>
> Is there a way to access those MDC Properties using this approach?
> If so how? Otherwise is there a different approach to get them?
>
> If anybody has experience with indexing logs in ElasticSearch with
> ServiceMix I would love to hear it.
>
> Thanks!
>
>
>
> --
> View this message in context:
> http://servicemix.396122.n5.nabble.com/Indexing-logs-in-ElasticSearch-tp5716875.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>

Reply via email to