org.eclipse.jetty.util.log.Log Maven / Gradle / Ivy
Show all versions of aem-sdk-api Show documentation
//
// ========================================================================
// Copyright (c) 1995-2022 Mort Bay Consulting Pty Ltd and others.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
//
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
//
package org.eclipse.jetty.util.log;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.eclipse.jetty.util.Loader;
import org.eclipse.jetty.util.Uptime;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
/**
* Logging.
* This class provides a static logging interface. If an instance of the
* org.slf4j.Logger class is found on the classpath, the static log methods
* are directed to a slf4j logger for "org.eclipse.log". Otherwise the logs
* are directed to stderr.
*
* The "org.eclipse.jetty.util.log.class" system property can be used
* to select a specific logging implementation.
*
* If the system property org.eclipse.jetty.util.log.IGNORED is set,
* then ignored exceptions are logged in detail.
*
* @see StdErrLog
* @see Slf4jLog
*
* @deprecated The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
*/
@Deprecated(since = "2021-05-27")
public class Log {
public static final String EXCEPTION = "EXCEPTION ";
public static final String IGNORED = "IGNORED EXCEPTION ";
/**
* The {@link Logger} implementation class name
*/
public static String __logClass;
/**
* Legacy flag indicating if {@link Logger#ignore(Throwable)} methods produce any output in the {@link Logger}s
*/
public static boolean __ignored;
/**
* Logging Configuration Properties
*/
protected static final Properties __props = new Properties();
private static final ConcurrentMap __loggers = new ConcurrentHashMap<>();
private static boolean __initialized;
private static Logger LOG;
static {
AccessController.doPrivileged(new PrivilegedAction