Hi i've come into a series of problems with logging so far when mixing helma and
other libraries around (especially the apache commons). For example i'm using FOP
all the time for render PDF reports, and if you use FOP in debug mode there are chances to
get StackOverflows here and there. So the only way to disable FOP debugging in helma is to
modify the Logging LogFactory class this way.
keep track of a system (but better app.properties) variable that keeps which kind of classes
you need to disable:
Vector disabledLoggers = new Vector ();
String disabledClasses = System.getProperty("helma.disablelog", "");
String[] disabled = disabledClasses.split (":");
for (int i = 0; i < disabled.length; i++)
{
String disableTempClass = disabled[i].trim();
if (disableTempClass.length () > 0)
disabledLoggers.add (disableTempClass);
}
then in public Log getInstance(String logname) we do:
// normalize log name
logname = logname.replaceAll("[^\\w\\d\\.]", "");
for (int i = 0; i < disabledLoggers.size(); i++)
if (logname.startsWith ((String) disabledLoggers.get (i)))
return getNoLog();
and getNoLog is like this:
// static global to the class no logger
static NoOpLog noLog = new NoOpLog ();
/**
* Get a no logger
* @return a logger that writes to Nirvana
*/
public static Log getNoLog() {
return noLog;
}
----------------------------------------------------------------------
Anyway while browsing the Logging code i see the line in constructor:
logdir = System.getProperty("helma.logdir", "log");
After doing some debugging, "helma.logdir" is set when Server starts from the server.properties logDir
property (if it isn't system wise), but actually server.properties is parsed AFTER the Logging class have
been initialized. So for instance we can have dicrepancies between the actual log directories and the
ones we have specified in the server.properties.
Let me know what u think
ps. Keep up the good work with HelmaNG !!!
Cheers,
Lucio
_______________________________________________
Helma-user mailing list
Helma-user@...
http://helma.org/mailman/listinfo/helma-user