Saturday, December 29, 2012

Setting Up logentries for OSGi Applications in Apache Karaf

What You'll Get


How To

Get an account at logentries. For a start, you'll get free forever account for 1 GB of logs per month, which is cool. :-)
We need to patch leappender-1-1.5.jar by adding OSGi manifest headers and attach it as fragment to pax-logging-service. (in CentOS/Amazon Linux, jar requires java-1.7.0-openjdk-devel yum package)
wget ''unzip -d leappender leappender-1.1.5.jarmkdir -vp leappender/META-INF
nano leappender/META-INF/MANIFEST.MF
Replace with:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: com.logentries.leappender
Bundle-SymbolicName: com.logentries.leappender
Bundle-Version: 1.1.5
Created-By: 1.7.0_09-icedtea (Oracle Corporation)
Export-Package: com.logentries.log4j;uses:="org.apache.log4j.spi";version="1.1.5"
Import-Package: org.apache.log4j,org.apache.log4j.spi
Fragment-Host: org.ops4j.pax.logging.pax-logging-service
rm -v; jar -cvfm leappender/META-INF/MANIFEST.MF -C leappender .
# Wrap it first using bnd
wget -O bnd.jar ''
java -jar bnd.jar wrap leappender-1.1.5.jar

our appender bundle should be present in the system folder and defined in etc/
The system folder has a “Maven repo like” structure. So you have to copy with:


In our example, it means:
mkdir -vp system/com/logentries/leappender/1.1.5/cp -v system/com/logentries/leappender/1.1.5/leappender-1.1.5.jar
and in etc/, we define the appender bundle just before the pax-logging-service bundle:
7.0/pax-logging-api-1.7.0.jar=8com/logentries/leappender/1.1.5/leappender-1.1.5.jar=8 org/ops4j/pax/logging/pax-logging-service/1.7.0/pax-logging-service-1.7.0.jar=8
Edit Karaf's etc/org.ops4j.pax.logging.cfg :
log4j.rootLogger = INFO, out, le, osgi:*
# Logentries appender
le.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %-32.32C %4L | %X{} - %X{} - %X{bundle.version} | %m%n
log4j.appender.le.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss ZZZ} %-5p: %F:%L %m
Note: The LOGENTRIES_TOKEN parameter can be found beside the logfile which we created earlier.
I can't get this to work automatically, so on first Karaf launch you'll get ClassNotFoundException, then you'll need to install it:
install mvn:com.logentries/leappender/1.1.5
bundle-level <id> 8
Now it should work.
At first launch you'll get a ClassNotFound exception. Shutdown Karaf and relaunch, it should work. (this was due to the leappender-1.1.5.jar in deploy/ folder, the system one still doesn't work automatically)
Happy logging! :-)


essayswriters said...

Logentries is a nice way to track your server/application logs. Free account available. :)
I blogged this how to at :
Hope this is useful. said...

It's really one of the best and the easiest ways. Thanks.

special-essays said...

Thanks for useful info!

Buy Essay said...

hey that's really a great post and i like this and thanks for sharing it with us! :)

Kat said...

Information is really useful. Thanks for sharing! Here at you can also find interesting information.

Amy Pearson said...

Great post! To find more info, follow the link!

alexxlexx said...

Thanks for help, you can find out more at

fitflop uk said...

After basically michael kors outlet out her coach factory assets tiffany and co jewelery in a low-coach factory blazer ensemble, the michael kors outlet reality coach outlet star louis vuitton handbags showed louis vuitton outlet off her coach factory outlet curves in ray ban sunglasses a see-tory burch outlet lace michael kors outlet this oakley sunglasses cheap week. But coach factory outlet worry, she coach store online bra this valentino time. I love coach outlet the louis vuitton outlet minimalist air jordan aesthetic true religion jeans brought to coach factory. He cheap ray ban sunglasses knows that timberland shoes because tory burch spending top prada outlet doesn't true religion outlet mean you coach factory outlet extra coach outlet store online bells <a href=""

Amira Taylor said...

The information you shared through your post is functional.I can also advice you

jenny Rocks said...

Need a custom written paper on any subject? No problem! Our writing company will definitely complete it for you. Moreover, our experts use a particular technique to any writing project! Therefore, we offer you to buy your essays at our services.

Inessa Small said...

Interesting post. By the way, students do not have to worry anymore about writing essays. Using first-rate custom essay writing service, that are available 24/7, learners will always get professionally written essays.

BobRobin said...

Student life may be very difficult. If you have some problems with your writing assignments, you can always put your trust in professional writers.

Luca Matrill said...

There are so many students who cannot write essay or they don’t have enough time.I also want to share the tip for getting online writing services that now write best essay without grammar or mistakes by employing online writers for you.

Marilyn Black said...

Most students in schools and tertiary educational background position organizations would commonly want essay help online with regards to their essay jobs would regularly examine internet expert services whereby those people students could purchase them.

Brendon Cooper said...

Just wanted to point you to students who struggle with writing essays. Please take a look and please feel free to make an enquiry without obligation. I might just save you some money in the longer term when you check out the benefits of this essay writing website

Nina Simone said...

Nice article/ My brother would like such information. He is a programmer=) And I am an essay writer. I earn money by essay writing for everyone. And you can look out at this
Address - and find reliable essay sewrvice=)

Frozen Juegos said...

I am very happy to read this. Appreciate your sharing
Jugar juego de frozen en lĂ­nea gratis, los nuevos de princesa de Disney juegos frozen - la princesa encantadora y linda. Divertirse frozen!

Facebook Descargar said...

This is also a very good post which I really enjoyed reading. It is not everyday that I have the possibility to see something
download descargar facebook para android gratis para Android celular and download free facebook descargar and descargar facebook gratis , descarga facebook

Cathy Roberson said...

I recently came across your blog and have been reading along. Nice blog. I will keep visiting this blog very often.

# Writer @ online cheap essay writing service

Tasha Reid said...

Well thanks!I am always searching online for articles that can help me.There is obviously a lot to know about this.Keep working,great job! and please welcome to my website.

River Weaver said...

Thankee for this post,it was so useful for me.Also,if somebody feel that writing is a weak point, then go to where professionals will help you and give you some useful tips.

kitty23 said...

Hi to all! Realy very thanks you for this info! visit this essay writing resource and you see how to the students life could be improved!

Post a Comment

Copyright 2009 Spring vs Java EE Web Dev. Powered by Blogger Blogger Templates create by Deluxe Templates. WP by Masterplan