|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.util.logging.LogService
public class LogService
The log service which is used to monitor zk-log.conf.
To initialize it, invoke init(java.lang.String, java.lang.Class). Note: Log could work
without LogService.
Implementation Note:
LogService cannot be a component (because ComponentManager depedns
on iDom, which depends on log). Thus, we use Singleton instead.
| Field Summary | |
|---|---|
protected java.lang.String |
_root
The name of the root logger that this logging service is monitoring. |
| Constructor Summary | |
|---|---|
LogService(java.lang.String root)
Constructor. |
|
| Method Summary | |
|---|---|
void |
configure(java.io.File file)
Configures based the properties stored in a file. |
void |
configure(java.util.Properties props)
Configures based the properties. |
void |
configure(java.lang.String filename)
Configures based the properties stored in a file. |
static LogService |
init(java.lang.String rootnm,
java.lang.Class cls)
Initializes the logging service. |
static boolean |
isInited(java.lang.String rootnm)
Returns whether the logging service is started, i.e., whether init(java.lang.String, java.lang.Class) is invoked. |
void |
stop()
Stops the service. |
static void |
stop(java.lang.String rootnm)
Stops the logging service |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final java.lang.String _root
| Constructor Detail |
|---|
public LogService(java.lang.String root)
init(java.lang.String, java.lang.Class) to
start the service.
| Method Detail |
|---|
public static final boolean isInited(java.lang.String rootnm)
init(java.lang.String, java.lang.Class) is invoked.
public static final LogService init(java.lang.String rootnm,
java.lang.Class cls)
Note: it also enables the hierarchy support of loggers by
calling Log.setHierarchy(boolean) with true.
Notice the heirachy is always disabled if a library property called
org.zkoss.util.logging.hierarchy.disabled is set to true.
rootnm - the name of the root logger. The logging service
registered handlers at the specified logger.cls - the implementation to start. If null, LogService
is used.public static final void stop(java.lang.String rootnm)
public void stop()
public final void configure(java.util.Properties props)
The key is a logger name and the value is the level. A special level, INHERIT or NULL, to denote resetting the level to be the same as the logger's parent.
props - the properties
public final void configure(java.io.File file)
throws java.io.FileNotFoundException,
java.io.IOException
The key is a logger name and the value is the level.
file - the file
java.io.FileNotFoundException
java.io.IOException
public final void configure(java.lang.String filename)
throws java.io.FileNotFoundException,
java.io.IOException
The key is a logger name and the value is the level.
filename - the filename
java.io.FileNotFoundException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||