|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertySyslog
public class PropertySyslog
Allows access to the system-logging facilities. Any class with a
main method that wants to implement the PropertyBearing
interface should rather extend this class then the
PropertyContainer.
A note on changing default behavior of the Syslog-class, which is
interesting if you use Syslog without loading any property syslog into your
java VM:
On class-load, a default system-logger configuration is passed to the Syslog class. If the properties of this class define system-wide loggers, they are added to the system logger class, if no logger of the given name is present. The keys ruling the definition of the loggers mean:
KEY_FILELOG: A simple file logger. The key points to
the file name. The key-extension #KEY_APPEND points to the
true or false for file appending.KEY_PRINTWRITERLOG: A printer logger. Valid mappings for
this key are System.out or System.err.KEY_MAILLOG: A mail logger. The key points to the smtp
server. The three key-extensions #KEY_TO, #KEY_CC, and
#KEY_BCC point to e-mail address of the receivers
(coma-separated list).KEY_TIMEROLLOVERLOG: A time roll-over logger. The key points
to basename of the logger. The key-extension #KEY_EXTENSION points
to the file name extension the logger should use, while
#KEY_NAMEFORMAT points to the formatter used for the date in the
logger file name. The key-extension #KEY_ROLL specifies the
roll-over intervall.KEY_DATAGRAMLOG: A logger sending its message via a datagram
socket to a logger server. Intended to work with linux-like syslog-daemons.
The key points to the hostname where the logger-server resides. Additionally
a #KEY_PORT server port, and a #KEY_FACILITY can be
specified. #KEY_NAME: The name of the logger. Used to avoid multiple
logger registration. This key is required and defaults to
LoggerKey:LoggerKeyValue.#KEY_LEVEL: The logging level. Valid numbers are 0 for
inherited (default), 1 for debug, 2 for info, 4 for warning, 8 for
error, and 16 for fatal logging messages. Note that the key points
to the string representation of the level names.#KEY_DATEFORMAT: The date/time formatter used in the logging
output.#KEY_CLASSWIDTH: The number of chars reserved for the class
name output.#KEY_CHANNELWIDTH: The number of chars reserved for the channel
name output. #KEY_CHANNELSHOW: A boolean defining wether the issuing class
should be included in the output. #KEY_THREADWIDTH: The number of chars reserved for the thread
name output. #KEY_THREADSHOW: A boolean defining wether the issuing class
should be included in the output. #KEY_HOSTWIDTH: The number of chars reserved for the host
name output.#KEY_HOSTSHOW: A boolean defining wether the issuing class
should be included in the output. SyslogAdjusting. Accessing any instance of a property syslog
class through this interface changes all loggers in the VM
this object resides in.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyContainer |
|---|
PropertyContainer.URLResource |
| Field Summary | |
|---|---|
static String |
APPEND
The key linked to file-append. |
static String |
BCC
The key to the mail receivers. |
static String |
CC
The key to the mail receivers. |
static String |
CHANNELSHOW
The key extension to the class-should-show of the logger. |
static String |
CHANNELWIDTH
The key extension to the class-width of the logger. |
static String |
CLASSWIDTH
The key extension to the class-width of the logger. |
static String |
DATECACHE
The key extension to the date cache of the logger. |
static String |
DATEFORMAT
The key extension to the date formatter of the logger. |
private static String |
DEFEXT
Default file-extension for time roll-over loggers. |
private static Map<String,String> |
DEFLOG
Default properties to use for the syslog. |
private static String |
DEFPRINTWRITER
Default print writer to use for the syslog. |
private static String |
DEFPRINTWRITERCACHE
Default print writer date cache time. |
private static String |
DEFPRINTWRITERFORMAT
Default print writer date format. |
private static String |
DEFPRINTWRITERLEVEL
Default print writer logger level. |
private static String |
DEFPRINTWRITERNAME
Default print writer logger name. |
private static int |
DEFROLL
Default roll-over time. |
static String |
EXTENSION
The key to the file extension of the time roll-over log. |
static String |
FACILITY
The key linked to the logger-server's facility. |
static String |
FLUSH
The key linked to auto-flush. |
static String |
HOSTSHOW
The key extension to the class-should-show of the logger. |
static String |
HOSTWIDTH
The key extension to the class-width of the logger. |
static String |
KEY_DATAGRAMLOG
The key linked to a datagram log. |
static String |
KEY_FILELOG
The key linked to a file log. |
static String |
KEY_MAILLOG
The key linked to a mail log. |
static String |
KEY_PRINTWRITERLOG
The key linked to a print writer log. |
static String |
KEY_REMOTELOG
A key, if present construct a RemoteLogServer. |
static String |
KEY_TIMEROLLOVERLOG
The key linked to a time roll over log. |
static String |
LEVEL
The key extension to the level of the logger (0-16). |
static String |
NAME
The key extension to the name of the logger. |
static String |
NAMEFORMAT
The key to the name format of the time roll-over log. |
static String |
PORT
The key linked to the logger-server's port. |
static String |
ROLL
The key to the roll-over intervall of the time roll-over log. |
static String |
THREADSHOW
The key extension to the class-should-show of the logger. |
static String |
THREADWIDTH
The key extension to the class-width of the logger. |
static String |
TO
The key to the mail receivers. |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_NOINITONCREATE, KEY_RESOURCEBUNDLES |
| Fields inherited from interface util.PropertyBearing |
|---|
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Constructor Summary | |
|---|---|
PropertySyslog(Map<String,String> props)
Constructs a new property syslog. |
|
| Method Summary | |
|---|---|
private static com.protomatter.syslog.Syslogger |
addAllLoggerProperties(Map<String,String> log,
String basekey,
com.protomatter.syslog.BasicLogger logger)
Adds a syslogger to the list of sysloggers. |
boolean |
addLogger(Map<String,String> logprop)
Adds a syslogger. |
static boolean |
addSysloggers(Map<String,String> props)
Scans the properties and adds static sysloggers. |
static void |
addThreadLogging()
Adds thread logging if possible. |
static void |
defaultLogging()
Clears all sysloggers. |
void |
disableLogging()
Disables all loggings. |
void |
enableLogging()
(Re-)Enables all loggings. |
List<String> |
getAllLoggers()
Returns a list of all logger names. |
private static String |
getLoggerName(Map log,
String key)
Gets the logger name. |
com.protomatter.syslog.LogPolicy |
getLoggerPolicy(String name)
Returns the syslog-logger policy with the specified name. |
void |
removeAllLoggers()
Removes all loggers. |
boolean |
removeLogger(String name)
Removes a logger. |
static List<com.protomatter.syslog.Syslogger> |
scanProperties(Map<String,String> log)
Scans the properties for syslog entries. |
static void |
setAllLogLevel(String mask)
Sets the log level for all loggers. |
boolean |
setLoggerPolicy(String name,
com.protomatter.syslog.LogPolicy newpolicy)
Sets the logger policy using the name of the logger. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String KEY_FILELOG
public static final String APPEND
public static final String FLUSH
public static final String KEY_PRINTWRITERLOG
public static final String KEY_MAILLOG
public static final String TO
KEY_MAILLOG.
public static final String CC
KEY_MAILLOG.
public static final String BCC
KEY_MAILLOG.
public static final String KEY_TIMEROLLOVERLOG
public static final String EXTENSION
public static final String ROLL
public static final String NAMEFORMAT
public static final String KEY_DATAGRAMLOG
public static final String PORT
public static final String FACILITY
public static final String KEY_REMOTELOG
RemoteLogServer.
public static final String NAME
public static final String LEVEL
public static final String DATEFORMAT
public static final String DATECACHE
public static final String CLASSWIDTH
public static final String CHANNELWIDTH
public static final String CHANNELSHOW
public static final String THREADWIDTH
public static final String THREADSHOW
public static final String HOSTWIDTH
public static final String HOSTSHOW
private static final Map<String,String> DEFLOG
private static final String DEFPRINTWRITER
private static final String DEFPRINTWRITERNAME
private static final String DEFPRINTWRITERLEVEL
private static final String DEFPRINTWRITERFORMAT
private static final String DEFPRINTWRITERCACHE
private static final int DEFROLL
private static final String DEFEXT
| Constructor Detail |
|---|
public PropertySyslog(Map<String,String> props)
| Method Detail |
|---|
public static void defaultLogging()
public static boolean addSysloggers(Map<String,String> props)
public com.protomatter.syslog.LogPolicy getLoggerPolicy(String name)
throws RemoteException
getLoggerPolicy in interface SyslogAdjustingRemoteException
public boolean setLoggerPolicy(String name,
com.protomatter.syslog.LogPolicy newpolicy)
throws RemoteException
setLoggerPolicy in interface SyslogAdjustingRemoteException
public List<String> getAllLoggers()
throws RemoteException
getAllLoggers in interface SyslogAdjustingRemoteException
public boolean removeLogger(String name)
throws RemoteException
removeLogger in interface SyslogAdjustingRemoteException
public void removeAllLoggers()
throws RemoteException
removeAllLoggers in interface SyslogAdjustingRemoteException
public boolean addLogger(Map<String,String> logprop)
throws RemoteException
addLogger in interface SyslogAdjustingRemoteException
public void disableLogging()
throws RemoteException
disableLogging in interface SyslogAdjustingRemoteException
public void enableLogging()
throws RemoteException
enableLogging in interface SyslogAdjustingRemoteExceptionpublic static List<com.protomatter.syslog.Syslogger> scanProperties(Map<String,String> log)
private static String getLoggerName(Map log,
String key)
public static void addThreadLogging()
public static void setAllLogLevel(String mask)
private static com.protomatter.syslog.Syslogger addAllLoggerProperties(Map<String,String> log,
String basekey,
com.protomatter.syslog.BasicLogger logger)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||