[Installation, Configuration & Deployment] - TCLFilter Usage?
by sleclere
I have successfully used the TCLFilter to separate application specific logging events ["APPLICATION_ONE", "APPLICATION_TWO"]. The problem is that application specific events are also being logged to my DailyRollingFileAppender ["FILE"], which is undesired behavior. What is the best way to eliminate this duplicate logging? I attempted to configure multiple TCLFilters in DailyRollingFileAppender ["FILE"] using AcceptOnMatch param = "false", which works a single TCLFilter is used, but because of the way the TCLFilter is written (see TCLFilter.java below), multiple TCLFilters cannot be used in this way(I need to filter both application specific logging events from DailyRollingFileAppender ["FILE"]). I am new to log4j, what am I missing here? Is there another way?
TCLFilter.java
*******************************
.....
public int decide(LoggingEvent event)
{
int ok = Filter.DENY;
if( acceptOnMatch == true )
{
ok = Filter.DENY;
if( isMatchingTCL() )
ok = Filter.ACCEPT;
}
else
{
/**
* ok ACCEPT by default, if isMatchingTCL() returns false, no other filters are evaluated
*/
ok = Filter.ACCEPT;
if( isMatchingTCL() )
ok = Filter.DENY;
}
return ok;
}
log4j.xml
*******************************
I attempted to post all of the appenders, but the forum would
not accept it for some reason...
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
<appender-ref ref="SMTP"/>
<appender-ref ref="APPLICATION_ONE"/>
<appender-ref ref="APPLICATION_TWO"/>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977027#3977027
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977027
19 years, 7 months
[Management, JMX/JBoss] - Why am I not receiving Notifications?
by mskonda
My primary goal is to receive notifications from Naming (JNDI) MBean - that is, receive notifications for any additions or deletions or modificatios to the JNDI namespace.
I have followed the wiki ListenerServiceMBeanSupport example and created a dummy notication lsitener which just prints out the info messages.
The xxx-service.xml is given below:
<?xml version="1.0" encoding="UTF-8"?>
|
| <server>
|
| <mbean code="com.cmi2.facility.notifications.JNDINotificationListener"
| name="cmi2-listeners:faciltiy=jndiNotifactionListener">
| <attribute name="SubscriptionList">
| <subscription-list>
| <mbean name="jboss:service=Naming">
| <filter factory="AttributeChangeNotificationFilterFactory">
| <enable attribute-name="State"/>
| <enable attribute-name="Name"/>
| <enable attribute-name="MethodMap"/>
| </filter>
| </mbean>
| </subscription-list>
| </attribute>
| </mbean>
| </server>
Unfortunately I can't get see any notifications received when I bind/unbind objects to the jndi namespace.
My listener is below:
| public class JNDINotificationListener extends ListenerServiceMBeanSupport
| implements JNDINotificationListenerMBean {
| /*
| * Logger
| */
| private Logger logger =
| Logger.getLogger(AbstractFlowComponent.class.getName());
|
| public JNDINotificationListener()
| {
| logger.info("JNDINotificationListener constructor");
| }
|
| public void startService() throws Exception
| {
| super.subscribe(true);
| }
|
| public void stopService() throws Exception
| {
| super.unsubscribe();
| }
| public void handleNotification2(Notification n, Object handBack)
| {
| logger.info("Received Notification: "+n+", handback: "+handBack);
| }
| }
|
|
Ideally i want to extend the notification listeners for other services too..
Any pointers to what I'm doing wrong?
Thanks
Madhu
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977022#3977022
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977022
19 years, 7 months
[Installation, Configuration & Deployment] - Re: Portal Settings Not Saving
by billw
Peter,
Yes, it probably is better in portal now that you mention it, but I really don't want to cross post now.
I am using JBossAS-4.0.3 SP1. The database is hibernate. It is the pre-configured JBoss that comes with Pentaho (1.2 RC2), but it is not Pentaho (at the moment) that I am struggling with. I will do a custom install when I get a bit more comfortable with the platform.
The issue is that I have had to go to manual editting of files, because almost all portal settings through the GUI have been wiped after portal restart. I have given all the privileges that I can to the admin user and a portal user. I have also chmod'd everything to see what is going on.
I have noticed odd behavior with the admin side on IE (does not work here) versus Firefox. I am sticking with Firefox for the configuration.
I appreciate your thoughts.
Bill
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977019#3977019
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977019
19 years, 7 months