001/** 002 * Logback: the reliable, generic, fast and flexible logging framework. 003 * Copyright (C) 1999-2015, QOS.ch. All rights reserved. 004 * 005 * This program and the accompanying materials are dual-licensed under 006 * either the terms of the Eclipse Public License v1.0 as published by 007 * the Eclipse Foundation 008 * 009 * or (per the licensee's choosing) 010 * 011 * under the terms of the GNU Lesser General Public License version 2.1 012 * as published by the Free Software Foundation. 013 */ 014package ch.qos.logback.access.sift; 015 016import ch.qos.logback.access.spi.IAccessEvent; 017import ch.qos.logback.core.joran.spi.DefaultClass; 018import ch.qos.logback.core.sift.Discriminator; 019import ch.qos.logback.core.sift.SiftingAppenderBase; 020 021/** 022 * This appender can contain other appenders which it can build dynamically 023 * depending on MDC values. The built appender is specified as part of a 024 * configuration file. 025 * 026 * <p>See the logback manual for further details. 027 * 028 * 029 * @author Ceki Gulcu 030 */ 031public class SiftingAppender extends SiftingAppenderBase<IAccessEvent> { 032 033 @Override 034 public void start() { 035 super.start(); 036 } 037 038 @Override 039 protected long getTimestamp(IAccessEvent event) { 040 return event.getTimeStamp(); 041 } 042 043 @Override 044 protected boolean eventMarksEndOfLife(IAccessEvent event) { 045 return false; 046 } 047 048 @Override 049 @DefaultClass(AccessEventDiscriminator.class) 050 public void setDiscriminator(Discriminator<IAccessEvent> discriminator) { 051 super.setDiscriminator(discriminator); 052 } 053}