com.signalfx.shaded.jetty.util.log.JavaUtilLog Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of signalfx-codahale Show documentation
Show all versions of signalfx-codahale Show documentation
Dropwizard Codahale metrics plugin for signalfx
The newest version!
//
// ========================================================================
// 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 com.signalfx.shaded.jetty.util.log;
import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.logging.Level;
import java.util.logging.LogManager;
import java.util.logging.LogRecord;
import com.signalfx.shaded.jetty.util.Loader;
/**
*
* Implementation of Jetty {@link Logger} based on {@link java.util.logging.Logger}.
*
*
*
* You can also set the logger level using
* standard java.util.logging configuration.
*
*
* Configuration Properties:
*
* - ${name|hierarchy}.LEVEL=(ALL|DEBUG|INFO|WARN|OFF)
* -
* Sets the level that the Logger should log at.
* Names can be a package name, or a fully qualified class name.
* Default: The default from the java.util.logging mechanism/configuration
*
* - com.signalfx.shaded.jetty.util.log.javautil.PROPERTIES=<property-resource-name>
* - If set, it is used as a classpath resource name to find a java.util.logging
* property file.
*
* Default: null
*
* - com.signalfx.shaded.jetty.util.log.javautil.SOURCE=(true|false)
* - Set the LogRecord source class and method for JavaUtilLog.
* Default: true
*
* - com.signalfx.shaded.jetty.util.log.SOURCE=(true|false)
* - Set the LogRecord source class and method for all Loggers.
* Default: depends on Logger class
*
*
*/
public class JavaUtilLog extends AbstractLogger
{
private static final String THIS_CLASS = JavaUtilLog.class.getName();
private static final boolean __source =
Boolean.parseBoolean(Log.__props.getProperty("com.signalfx.shaded.jetty.util.log.SOURCE",
Log.__props.getProperty("com.signalfx.shaded.jetty.util.log.javautil.SOURCE", "true")));
private static boolean _initialized = false;
private Level configuredLevel;
private java.util.logging.Logger _logger;
public JavaUtilLog()
{
this("com.signalfx.shaded.jetty.util.log.javautil");
}
public JavaUtilLog(String name)
{
synchronized (JavaUtilLog.class)
{
if (!_initialized)
{
_initialized = true;
final String properties = Log.__props.getProperty("com.signalfx.shaded.jetty.util.log.javautil.PROPERTIES", null);
if (properties != null)
{
AccessController.doPrivileged(new PrivilegedAction
© 2015 - 2024 Weber Informatics LLC | Privacy Policy