On Wed, Apr 16, 2014 at 5:12 PM, Jody Garnett <jody.garnett@anonymised.com>wrote:
One thing that always causes questions is our standard JAI stack trace.
Error: Could not find mediaLib accelerator wrapper classes. Continuing in
pure Java mode.
Occurs in: com.sun.media.jai.mlib.MediaLibAccessor
java.lang.NoClassDefFoundError: com/sun/medialib/mlib/Image
at com.sun.media.jai.mlib.MediaLibAccessor$1.run(MediaLibAccessor.java:248)
at java.security.AccessController.doPrivileged(Native Method)
etc...
I wonder if this article
https://blogs.oracle.com/nickstephen/entry/java_redirecting_system_out_andcould help us capture this output (and filter it out?).
Seems like an interesting avenue. For the JAI one I'd follow Ian
suggestion, but of course that one won't tap
other sysout that might have been left in the code by mistake.
So I'd also be good with the one you propose, with a few observations.
Geoserver can be deployed
along other applications, overriding the out is probably going to affect
everybody,
and it might be "nasty" to have other apps outs and errs in our logs only.
Also, the method you are going to use can throw a SecurityException (
http://docs.oracle.com/javase/6/docs/api/java/lang/System.html#setOut(java.io.PrintStream)
)
and I bet in some enviroments it will.
Long story short:
* it must be possible to de-activate the system out/err redirect to logs
* we should guard the attempt to redirect them in a try/catch to avoid
geoserver startup issues in locked down environments
Also, not sure what is going to happen if we re-init the logging system at
runtime
when someone changes the logging levels from the GUI, that is, are we going
to lose
the loggers used to redirect out and err, or are they maybe ignoring the
new logging
settings, and so on (maybe not, but we should check).
Cheers
Andrea
--
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------