|
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.protomatter.syslog.SimpleLogPolicy | +--com.protomatter.syslog.PerClassPolicy
A policy that can make decision on a per-class basis. It maintains a default log mask and channel list itself, but also has a list of "policy groups" that each have a log mask and channel list of their own in addition to a list of class names that their mask and channel list applies to. If a message coming from a class in one of those lists matches the mask and channel list, the message is logged. If not, but the message severity and channel match the default mask and channel list, it is also logged. Otherwise, the message is ignored.
This policy can be used to effectively say that messages from classes A and B should be logged if their severity is WARNING or greater, and that messages from classes C and D should be logged if their severity is INFO or greater and on a certain set of channels and that if all else fails, messages at or above the INFO level will be logged. It's very configurable.
Each "class name" is actually a Perl5 regular expression, so you can match things like "com.protomatter.syslog.*" and other stuff. This functionality uses the ORO regular expression package, now part of the Apache Jakarta project.
XML configuration class
Inner Class Summary | |
static class |
PerClassPolicy.PolicyGroup
A policy within a policy -- this is exactly like the SimpleLogPolicy except that it also checks to see if the class issuing the log message is in some set. |
Constructor Summary | |
PerClassPolicy()
Default constructor. |
Method Summary | |
void |
addPolicyGroup(PerClassPolicy.PolicyGroup group)
Add a policy group to our list. |
java.util.List |
getGroupList()
Get the list of policy groups. |
java.util.Iterator |
getPolicyGroups()
Get the list of policy groups. |
void |
removePolicyGroup(PerClassPolicy.PolicyGroup group)
Remove a policy group from our list. |
void |
setGroupList(java.util.List list)
Set the list of policy groups. |
boolean |
shouldLog(SyslogMessage message)
Decide if the message should be logged. |
Methods inherited from class com.protomatter.syslog.SimpleLogPolicy |
addChannel, getChannels, getLogMask, getName, inMask, removeAllChannels, removeChannel, setChannels, setChannels, setLogMask, setLogMask, setName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PerClassPolicy()
Method Detail |
public java.util.List getGroupList()
public void setGroupList(java.util.List list)
public boolean shouldLog(SyslogMessage message)
shouldLog
in class SimpleLogPolicy
public java.util.Iterator getPolicyGroups()
public void addPolicyGroup(PerClassPolicy.PolicyGroup group)
public void removePolicyGroup(PerClassPolicy.PolicyGroup group)
|
Protomatter Software v1.1.7 Copyright 1998-2002 Nate Sammons |
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Protomatter Software v1.1.7 | http://protomatter.sourceforge.net/1.1.7 |