Logback and webapplications

Lately I prefer to use Logback for logging purposes. Logback natively supports slf4j, a log abstraction api through other logging frameworks all can log to a logging framework of your choice.
When using logback in webapplication and you want your logging configuration file outside of your app you can set a systemproperty to point to the location.
However if you want it configured like you are used to do with Spring, log4j and the log4j servletcontext listener, you have to write the context listener yourself.
It’s a bit silly to do that again for every webapplication. So here it is, the logback-webfragment.
The logback-webfragment is a Servlet 3.x webfragment configered to be loaded before other fragments. It takes a location from a web.xml configparameter and loads the configuration from there. Optionally you can add another context parameter to enable one of the 5 default configurations I’ve added.
The idea for the code of the listener is taken from this ticket in logbacks issuetracker. Currently logback-webfragment will only work for Java 1.7 and higher. The maven artifact name is named aaa-logback-webfragment. The aaa is there to increase the chance that the webfragment is loaded before others that are also configured to be loaded first.
In analogy to logback itself the webfragments license is EPL. It is not yet in maven central repo. Maybe I have to test it a bit more.

A commuters context framework

During commuting you see a lot if people reading a book or a newspaper. But the geek or nerd that I am keeps on programming.
This led to another ‘invention of the wheel’. I wrote my own CDI ( not or not yet JSR-299 compatible) framework.
Probably nobody is waiting for that and certainly not since it’s not compatible with Spring nor Java EE cdi. But what the heck, I don’t care. I had fun writing it and that’s what it’s all about. Of course it would be even more fun if somebody else finds it usable.

Project info:
License: Apache 2.0 (of course!)
Project on sourceforge here
Wiki and bugtracker here
CI on Cloudbees here
Javadoc here
Maven Site here

Why would I use it?
1. For small applications that don’t do much Java CDI and Spring could be to much overhead. Using a fairly simple look-a-like that is more lightweight will be less overhead while you can still benefit from some kind of CDI. (e.g. for small swing apps )
2. It’s basic framework, easy to understand and extend.
3. It’s in Java 7 ( although it might run under 6, haven’t tried that )

Why did I create it?
I don’t really like the way that Java CDI forces you to create a wildgrow of annotations. I much more prefer the way Spring let you do injections but I’m not fond of the total Spring package. So perhaps the redlab-context project is an answer to both. And I have fun creating it while traveling.

If I use it myself (which I will do), I’ll probably discover some shortcomings and enhance it.

Things that are on the roadmap are to provide support for integration with Spring, Java CDI and your own stuff.
Oh and write some wiki pages with documentation. Not the most fun stuff to write but how would you otherwise know how to use it.

Currently you can’t get it from the Central Maven repository yet but you can download it from sourceforge. If my own usage proves it’s allright for using it, I’ll perhaps upload it to Maven Central

3 months of JRebel

Found this post in draft status. Seemed to have forgotten to publish it. Here it goes.

I’ve used JRebel for 3 months. The demo license has come to an end in January and I’m already missing it.

In 3 months time JRebel saved my about 3 days, that is a day a month. Now I must confess, I haven’t had to start up webapps for at least one month and another month was 3 weeks of holidays . So these stats actually count for only a month and a half, which makes them even look better!

Currently I’m without JRebel, restarting the jersey/spring web applications every 2 deploys. I’m trying to advertise the usage of JRebel a bit, but with the crisis it seems there is no money. If I only was a manager …

Why should you use JRebel? That has been summed up before see here and here

Wouldn’t everyone want a tool like that?

I would like to see LiveRebel in action where I work now, but don’t think the workplace wants it 🙁

note: I’m not affiliated with zeroturnaround in any way!