Create a new {@link Log} implementation, based
on the given name.
The specific {@link Log} implementation returned
is determined by the value of the
org.apache.commons.logging.log property.
The value of org.apache.commons.logging.log may be set to
the fully specified name of a class that implements
the {@link Log} interface. This class must also
have a public constructor that takes a single
{@link String} argument (containing the name
of the {@link Log} to be constructed.
When org.apache.commons.logging.log is not set,
or when no corresponding class can be found,
this method will return a Log4JLogger
if the log4j Logger class is
available in the {@link LogSource}'s classpath, or a
Jdk14Logger if we are on a JDK 1.4 or later system, or
NoOpLog if neither of the above conditions is true.
Log log = null;
try {
Object[] args = new Object[1];
args[0] = name;
log = (Log) (logImplctor.newInstance(args));
} catch (Throwable t) {
log = null;
}
if (null == log) {
log = new NoOpLog(name);
}
return log;