001package org.apache.log4j.rewrite; 002 003import org.apache.log4j.spi.LoggingEvent; 004 005/* 006* Licensed to the Apache Software Foundation (ASF) under one or more 007* contributor license agreements. See the NOTICE file distributed with 008* this work for additional information regarding copyright ownership. 009* The ASF licenses this file to You under the Apache License, Version 2.0 010* (the "License"); you may not use this file except in compliance with 011* the License. You may obtain a copy of the License at 012* 013* http://www.apache.org/licenses/LICENSE-2.0 014* 015* Unless required by applicable law or agreed to in writing, software 016* distributed under the License is distributed on an "AS IS" BASIS, 017* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018* See the License for the specific language governing permissions and 019* limitations under the License. 020*/ 021 022/** 023 * This interface is implemented to provide a rewrite 024 * strategy for RewriteAppender. RewriteAppender will 025 * call the rewrite method with a source logging event. 026 * The strategy may return that event, create a new event 027 * or return null to suppress the logging request. 028 */ 029public interface RewritePolicy { 030 /** 031 * Rewrite a logging event. 032 * @param source a logging event that may be returned or 033 * used to create a new logging event. 034 * @return a logging event or null to suppress processing. 035 */ 036 LoggingEvent rewrite(final LoggingEvent source); 037}