/*
 *  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.asyncweb.server.transport.mina;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * An <code>ExceptionMonitor</code> which simply logs exceptions.
 *
 * @author irvingd
 *
 */
class LoggingExceptionMonitor extends org.apache.mina.util.ExceptionMonitor {

    private static final Logger LOG = LoggerFactory
            .getLogger(LoggingExceptionMonitor.class);

    @Override
    public void exceptionCaught(Throwable e) {
        if (LOG.isWarnEnabled()) {
            LOG.warn("NIOTransport encountered exception.", e);
        }
    }
}
