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.

Setting up the mobile workstation

Post to myself so I don’t forget how and what I installed

In July, 3 days before my holidays kicked off, my worklaptop got stolen. Meanwhile I have a new one. An Asus N76V which contains an i7, 8gb ram and a nice geforce 630m 2gb ram videocard for occasional gaming. This all works nice and smooth under Windows7. But for working I prefer Linux of course!
And there the fun starts:
As OS I choose a freshly downloaded Ubuntu Desktop 64bit Continue reading “Setting up the mobile workstation”

My Wireless D-LINK Router freaked out

After flashing my mobile HTC Wildfire with Cyanogen 7 mod – Android 2.3.7, which is really nice by the way, works faster than HTC’s own Android 2.2.1 build, the only thing I had to do was flash a separate update for the mobile’s wifi/gps/3g connection, GPS wasn’t working. But at home where I’m using a DIR-615 a D-LINK router with b/g/n Wifi and 4 10/100Mbps ports the mobile didn’t get an internet connection through the Wifi. Or it did, but lost it regularly, or was connected to the Wifi but didn’t get internet.

So I thought perhaps the transmit power of my router is not good enough. I had set it on the lowest transmit power upon it’s first connection. And thus I increased the transmit power to medium. Yihaa, my mobile connected properly. Case solved and dismissed!

At least that’s what I thought. The day after I noticed both of my laptops internet was really slow. I speed tested from one laptop to another, that was fine. Internet still slow. Started to suspect a dropout on the providers network. But that seemed fine too. I rebooted my router, my internet cable connection, and oh! internet was back. For 5 minutes, then the connection dropped again to 0.5kbps download and 5kpbs upload.

After digging up a cable from the cellar and connecting that I noticed that a wired connection did not suffer from speed issues. (The same counts for the HTC, did’t seem to suffer from bandwidth drop, which is weird)

Then I remembered that I changed the D-LINKs transmit power from low to medium. I thought, no that can’t be it, but it’s the only thing I changed, so I proceeded. Set the transmit power back to low. And yes, both of the laptops suddenly had full WiFi bandwidth again.

I would have never suspected that when connection on low power is fine, it is not fine on higher power.

Accoring to the manual:

Transmit Power
Normally the wireless transmitter operates at 100% power. In some circumstances, however, there might be a need to isolate specific frequencies to a smaller area. By reducing the power of the radio, you can prevent transmissions from reaching beyond your corporate/home office or designated wireless area.

What does that have to do with the bandwidth?