Since I have got no reply, I did some thorough investigation about it and a found a somewhat near solution to what I am looking for.
This can be enabled through the Java instrumentation API which allows you to insert "programming statements"
to a method at runtime and upon the start of the Java virtual machine. What you have to do is to write a class
in a specific form that and pass it to JVM as an argument when it starts.
Check this tutorial :
http://today.java.net/pub/a/today/2008/04/24/add-logging-at-class-load-time-with-instrumentation.html