1 : <?php
2 : /**
3 : * Licensed to the Apache Software Foundation (ASF) under one or more
4 : * contributor license agreements. See the NOTICE file distributed with
5 : * this work for additional information regarding copyright ownership.
6 : * The ASF licenses this file to You under the Apache License, Version 2.0
7 : * (the "License"); you may not use this file except in compliance with
8 : * the License. You may obtain a copy of the License at
9 : *
10 : * http://www.apache.org/licenses/LICENSE-2.0
11 : *
12 : * Unless required by applicable law or agreed to in writing, software
13 : * distributed under the License is distributed on an "AS IS" BASIS,
14 : * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 : * See the License for the specific language governing permissions and
16 : * limitations under the License.
17 : *
18 : * @package log4php
19 : */
20 :
21 : /**
22 : * This filter drops all logging events.
23 : *
24 : * You can add this filter to the end of a filter chain to
25 : * switch from the default "accept all unless instructed otherwise"
26 : * filtering behaviour to a "deny all unless instructed otherwise"
27 : * behaviour.
28 : *
29 : * <p>
30 : * An example for this filter:
31 : *
32 : * {@example ../../examples/php/filter_denyall.php 19}
33 : *
34 : * <p>
35 : * The corresponding XML file:
36 : *
37 : * {@example ../../examples/resources/filter_denyall.xml 18}
38 : *
39 : * @version $Revision: 883108 $
40 : * @package log4php
41 : * @subpackage filters
42 : * @since 0.3
43 : */
44 : class LoggerFilterDenyAll extends LoggerFilter {
45 :
46 : /**
47 : * Always returns the integer constant {@link LoggerFilter::DENY}
48 : * regardless of the {@link LoggerLoggingEvent} parameter.
49 : *
50 : * @param LoggerLoggingEvent $event The {@link LoggerLoggingEvent} to filter.
51 : * @return LoggerFilter::DENY Always returns {@link LoggerFilter::DENY}
52 : */
53 : public function decide(LoggerLoggingEvent $event) {
54 3 : return LoggerFilter::DENY;
55 : }
56 : }
|