public final class CmsLog
extends java.lang.Object
The OpenCms logging mechanism is based on Apache Commons Logging.
However, log4j is shipped with OpenCms and assumed to be used as default logging mechanism.
Since apparently Commons Logging may cause issues in more complex classloader scenarios,
we may switch the logging interface to log4j UGLI
once the final release is available.
The log4j configuration file shipped with OpenCms is located
in ${opencms.WEB-INF}/classes/log4j.properties
. OpenCms will auto-configure itself
to write it's log file to ${opencms.WEB-INF}/logs/opencms.log
. This default behaviour
can be supressed by either using a log4j configuration file from another location, or by setting the
special property ${opencms.set.logfile}
in the log4j configuration file to false
.
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
FILE_LOG
The name of the opencms.log file.
|
static java.lang.String |
FOLDER_LOGS
Path to the "logs" folder relative to the "WEB-INF" directory of the application.
|
static org.apache.commons.logging.Log |
INIT
Log for initialization messages.
|
限定符和类型 | 方法和说明 |
---|---|
static org.apache.commons.logging.Log |
getLog(java.lang.Object obj)
Returns the log for the selected object.
|
protected static java.lang.String |
getLogFileRfsPath()
Returns the filename of the log file (in the "real" file system).
|
public static final java.lang.String FILE_LOG
public static final java.lang.String FOLDER_LOGS
public static final org.apache.commons.logging.Log INIT
public static org.apache.commons.logging.Log getLog(java.lang.Object obj)
If the provided object is a String, this String will be used as channel name. Otherwise the objects class name will be used as channel name.
obj
- the object channel to useprotected static java.lang.String getLogFileRfsPath()
If the method returns null
, this means that the log
file is not managed by OpenCms.