Skip to content
Snippets Groups Projects
Commit 628e11ae authored by brinn's avatar brinn
Browse files

(merged from Datamover 1.0.x branch, r2154, r2155)

add: a TriggeringEventEvaluator that allows to overwrite the SMTPAppender's default to only send out an email message on message of level ERROR and above
fix: ensure that NOTIFY messages of level INFO are actually sent out as an email

SVN: 2165
parent 4b6e99e0
No related merge requests found
/*
* Copyright 2007 ETH Zuerich, CISD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ch.systemsx.cisd.common.logging;
import org.apache.log4j.spi.LoggingEvent;
import org.apache.log4j.spi.TriggeringEventEvaluator;
/**
* A {@link TriggeringEventEvaluator} that is always true. Can be used, e.g. to make the
* {@link org.apache.log4j.net.SMTPAppender} send email also on non-error conditions.;
*
* @author Bernd Rinn
*/
public class AlwaysTrueTriggeringEventEvaluator implements TriggeringEventEvaluator
{
public boolean isTriggeringEvent(LoggingEvent event)
{
return true;
}
}
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
<param name="From" value="datamover@localhost" /> <param name="From" value="datamover@localhost" />
<param name="To" value="root@localhost" /> <param name="To" value="root@localhost" />
<param name="Subject" value="ATTENTION: data mover" /> <param name="Subject" value="ATTENTION: data mover" />
<param name="EvaluatorClass" value="ch.systemsx.cisd.common.logging.AlwaysTrueTriggeringEventEvaluator" />
<layout class="org.apache.log4j.PatternLayout"> <layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%t] %c - %m%n"/> <param name="ConversionPattern" value="%d %-5p [%t] %c - %m%n"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment