Class PatchLogger
- java.lang.Object
-
- io.opentelemetry.javaagent.bootstrap.PatchLogger
-
public class PatchLogger extends Object
Dependencies of the agent sometimes call java.util.logging.Logger.getLogger(). This can have the effect of initializing the global LogManager incompatibly with the user's app.Shadow rewrites will redirect those calls to this class, which will return a safe PatchLogger.
This also has the desired outcome of redirecting all logging to a single destination (SLF4J).
-
-
Field Summary
Fields Modifier and Type Field Description static PatchLoggerglobalstatic StringGLOBAL_LOGGER_NAME
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfig(String msg)voidentering(String sourceClass, String sourceMethod)voidentering(String sourceClass, String sourceMethod, Object param1)voidentering(String sourceClass, String sourceMethod, Object[] params)voidexiting(String sourceClass, String sourceMethod)voidexiting(String sourceClass, String sourceMethod, Object result)voidfine(String msg)voidfiner(String msg)voidfinest(String msg)static PatchLoggergetAnonymousLogger()static PatchLoggergetAnonymousLogger(String resourceBundleName)static PatchLoggergetGlobal()LevelgetLevel()static PatchLoggergetLogger(String name)static PatchLoggergetLogger(String name, String resourceBundleName)StringgetName()PatchLoggergetParent()ResourceBundlegetResourceBundle()StringgetResourceBundleName()voidinfo(String msg)booleanisLoggable(Level level)voidlog(Level level, String msg)voidlog(Level level, String msg, Object param1)voidlog(Level level, String msg, Object[] params)voidlog(Level level, String msg, Throwable thrown)voidlog(LogRecord record)voidlogp(Level level, String sourceClass, String sourceMethod, String msg)voidlogp(Level level, String sourceClass, String sourceMethod, String msg, Object param1)voidlogp(Level level, String sourceClass, String sourceMethod, String msg, Object[] params)voidlogp(Level level, String sourceClass, String sourceMethod, String msg, Throwable thrown)voidlogrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg)voidlogrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object param1)voidlogrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object[] params)voidlogrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Throwable thrown)voidlogrb(Level level, String sourceClass, String sourceMethod, ResourceBundle bundle, String msg, Object... params)voidlogrb(Level level, String sourceClass, String sourceMethod, ResourceBundle bundle, String msg, Throwable thrown)voidlogrb(Level level, ResourceBundle bundle, String msg, Object... params)voidlogrb(Level level, ResourceBundle bundle, String msg, Throwable thrown)voidsetLevel(Level newLevel)voidsetParent(PatchLogger parent)voidsetResourceBundle(ResourceBundle resourceBundle)voidsevere(String msg)voidthrowing(String sourceClass, String sourceMethod, Throwable thrown)voidwarning(String msg)
-
-
-
Field Detail
-
GLOBAL_LOGGER_NAME
public static final String GLOBAL_LOGGER_NAME
- See Also:
- Constant Field Values
-
global
public static final PatchLogger global
-
-
Method Detail
-
getLogger
public static PatchLogger getLogger(String name)
-
getLogger
public static PatchLogger getLogger(String name, String resourceBundleName)
-
getName
public String getName()
-
severe
public void severe(String msg)
-
warning
public void warning(String msg)
-
info
public void info(String msg)
-
config
public void config(String msg)
-
fine
public void fine(String msg)
-
finer
public void finer(String msg)
-
finest
public void finest(String msg)
-
log
public void log(LogRecord record)
-
isLoggable
public boolean isLoggable(Level level)
-
getLevel
public Level getLevel()
-
logp
public void logp(Level level, String sourceClass, String sourceMethod, String msg, Object param1)
-
logp
public void logp(Level level, String sourceClass, String sourceMethod, String msg, Object[] params)
-
logp
public void logp(Level level, String sourceClass, String sourceMethod, String msg, Throwable thrown)
-
logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg)
-
logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object param1)
-
logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object[] params)
-
logrb
public void logrb(Level level, String sourceClass, String sourceMethod, ResourceBundle bundle, String msg, Object... params)
-
logrb
public void logrb(Level level, ResourceBundle bundle, String msg, Object... params)
-
logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Throwable thrown)
-
logrb
public void logrb(Level level, String sourceClass, String sourceMethod, ResourceBundle bundle, String msg, Throwable thrown)
-
logrb
public void logrb(Level level, ResourceBundle bundle, String msg, Throwable thrown)
-
getResourceBundle
public ResourceBundle getResourceBundle()
-
setResourceBundle
public void setResourceBundle(ResourceBundle resourceBundle)
-
getResourceBundleName
public String getResourceBundleName()
-
getParent
public PatchLogger getParent()
-
setParent
public void setParent(PatchLogger parent)
-
setLevel
public void setLevel(Level newLevel)
-
getAnonymousLogger
public static PatchLogger getAnonymousLogger()
-
getAnonymousLogger
public static PatchLogger getAnonymousLogger(String resourceBundleName)
-
getGlobal
public static final PatchLogger getGlobal()
-
-