diff --git a/common/source/java/ch/systemsx/cisd/common/logging/AlwaysTrueTriggeringEventEvaluator.java b/common/source/java/ch/systemsx/cisd/common/logging/AlwaysTrueTriggeringEventEvaluator.java new file mode 100644 index 0000000000000000000000000000000000000000..4592979e07d8374fbbdd8990359aa93788470171 --- /dev/null +++ b/common/source/java/ch/systemsx/cisd/common/logging/AlwaysTrueTriggeringEventEvaluator.java @@ -0,0 +1,36 @@ +/* + * 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; + } + +} diff --git a/datamover/dist/etc/log.xml b/datamover/dist/etc/log.xml index 4a29d6ef5715bd5b18e886f8e1aaaccd5b0414f1..036f79d29e44a3b5a183467cc031200debadae79 100644 --- a/datamover/dist/etc/log.xml +++ b/datamover/dist/etc/log.xml @@ -40,6 +40,7 @@ <param name="From" value="datamover@localhost" /> <param name="To" value="root@localhost" /> <param name="Subject" value="ATTENTION: data mover" /> + <param name="EvaluatorClass" value="ch.systemsx.cisd.common.logging.AlwaysTrueTriggeringEventEvaluator" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d %-5p [%t] %c - %m%n"/>