Java Dynamic Property Configuration

Recently, I had the need of changing config.properties (predefined application configuration) in Java without restarting the application. I found out a very nice library from Netflix which constantly looks for the changes in your config file and applies these variables runtime.

Continue reading

Logging uncaught exception (redirecting from sysout to logger)

Uncaught exceptions in Java are handled by the System. The JVM usually logs the exception into the System.err and then shuts down. But in case of web applications its different. It logs the printstack trace to server console and then continues. Even though most of the time System.err is redirected to a file system, I wanted a better way of handling it just like any other exception stacktrace. I wanted logger ( you can use log4j too) to handle it, so I it can help maintainers better.
Java gives Thread.UncaughtExceptionHandler to handle any such exceptions. I implemented my own.

Continue reading