ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/tomcat/dbcp/dbcp2/SwallowedExceptionLogger.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/tomcat/dbcp/dbcp2/SwallowedExceptionLogger.java
Status
scanned
Type
file
Name
SwallowedExceptionLogger.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
2218 (2.2 KB)
MD5
3dd683541d4d8da5cbfad0e5b4930999
SHA1
e42e50ab71875e33fbfa23dfc093ae4b87780da6
SHA256
9ea7fef5a2167025f15927abe73bb9e6e4e4c3695a65d8b9dd25f4692d0acc97
SHA512

      
    
SHA1_git
f0ea6b6981b600a7477d7231a0c9ad95bc79f8ce
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
SwallowedExceptionLogger.java | 2.2 KB |

/* * 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 * * https://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.tomcat.dbcp.dbcp2; import org.apache.juli.logging.Log; import org.apache.tomcat.dbcp.pool2.SwallowedExceptionListener; /** * Class for logging swallowed exceptions. * * @since 2.0 */ public class SwallowedExceptionLogger implements SwallowedExceptionListener { private final Log log; private final boolean logExpiredConnections; /** * Create a SwallowedExceptionLogger with the given logger. By default, expired connection logging is turned on. * * @param log * logger */ public SwallowedExceptionLogger(final Log log) { this(log, true); } /** * Create a SwallowedExceptionLogger with the given logger and expired connection logging property. * * @param log * logger * @param logExpiredConnections * false suppresses logging of expired connection events */ public SwallowedExceptionLogger(final Log log, final boolean logExpiredConnections) { this.log = log; this.logExpiredConnections = logExpiredConnections; } @Override public void onSwallowException(final Exception e) { if (logExpiredConnections || !(e instanceof LifetimeExceededException)) { log.warn(Utils.getMessage("swallowedExceptionLogger.onSwallowedException"), e); } } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
50.0
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-eb6b5ae0-4f88-4e9b-d67c-c6c8e733b1cd apache-2.0 Apache-2.0
URL Start line End line
https://www.apache.org/licenses/LICENSE-2.0 9 9