In sun's sdk 1.4 documentation on logging, they say: "void warning(Stringmsg); For this second set of methods, the Logging framework will make a "best effort" to determine which class and method called into the logging framework [...]. However, it is important to realize that this automatically inferred information may only be approximate. The latest generation of virtual machines perform extensive optimizations when JITing and may entirely remove stack frames, making it impossible to reliably locate the calling class and method. " so, when is this short version reliable ? is it only problematic with JIT compiler or are there other critical issues ? if detecting the method is not reliable, where's the point of this framework at all ? thank y'all dennis
Thomas Smets
Ranch Hand
Joined: Dec 11, 2001
Posts: 111
posted
0
Dennis, Be professionnal use Log4J. It's a technology from I.B.M. given in GPL ... What else do you want ? Thomas,
Thomas Smets
Just another developper
Ilja Preuss
author
Sheriff
Joined: Jul 11, 2001
Posts: 14112
posted
0
Dennis, the framework is just giving you the choice: Either do some more work and get the most precision, or use the automated mechanism and live with the potential impreciseness. Thomas, are you implying that using the JDK1.4 logging framework would be nonprofessional???
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
thanks guys ! gonna use log4j dennis
Ilja Preuss
author
Sheriff
Joined: Jul 11, 2001
Posts: 14112
posted
0
Originally posted by Dennis K�hn: gonna use log4j
Aha, why? Please notice that log4j doesn't seem to give you the option to explicitely name the source of a log event, so it always works in the imprecise mode that the JDK1.4 mechanism gives you as an option.
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
seen from this point, you're right. The company I work for has just managed to make their way to jdk 1.3. It will be at least one more year until 1.4 will be a strategic release here. I would have extracted the logging from the 1.4 runtime jar, but it doesn't work (can't recompile it under 1.3) because sun, who are getting as nasty as M$, "forgot" to include them sun.reflect sources in the 1.4 src, which are required for the logging to work. instead of adapting all that shid and still not having method names logged, it takes less to just use a 3rd party product and use clear ifaces where application and logging controls meet the actual logging mechanism, so i still can change easily to the 1.4-built-in jdk logging.