Repository: logging-log4j2
Updated Branches:
  refs/heads/master 0fe1b47b2 -> 23b4dc5ea


Adds a TriggeringPolicy that never triggers and is handy for edge-cases
in tests for example.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/23b4dc5e
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/23b4dc5e
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/23b4dc5e

Branch: refs/heads/master
Commit: 23b4dc5ea026564f6c889214e11aa5e56faaa3bf
Parents: 0fe1b47
Author: Gary Gregory <[email protected]>
Authored: Fri Jul 13 18:09:15 2018 -0600
Committer: Gary Gregory <[email protected]>
Committed: Fri Jul 13 18:09:15 2018 -0600

----------------------------------------------------------------------
 .../appender/rolling/NoOpTriggeringPolicy.java  | 43 ++++++++++++++++++++
 1 file changed, 43 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/23b4dc5e/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/NoOpTriggeringPolicy.java
----------------------------------------------------------------------
diff --git 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/NoOpTriggeringPolicy.java
 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/NoOpTriggeringPolicy.java
new file mode 100644
index 0000000..d28da42
--- /dev/null
+++ 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/NoOpTriggeringPolicy.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.logging.log4j.core.appender.rolling;
+
+import org.apache.logging.log4j.core.Core;
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+
+/*
+ * Never triggers and is handy for edge-cases in tests for example.
+ * 
+ * @since 2.11.1
+ */
+@Plugin(name = "NoOpTriggeringPolicy", category = Core.CATEGORY_NAME, 
printObject = true)
+public class NoOpTriggeringPolicy extends AbstractTriggeringPolicy {
+
+       @Override
+       public void initialize(final RollingFileManager manager) {
+               // NoOp
+       }
+
+       @Override
+       public boolean isTriggeringEvent(final LogEvent logEvent) {
+               // NoOp
+               return false;
+       }
+
+}

Reply via email to