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 PatchLogger
global
static String
GLOBAL_LOGGER_NAME
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
config(String msg)
void
entering(String sourceClass, String sourceMethod)
void
entering(String sourceClass, String sourceMethod, Object param1)
void
entering(String sourceClass, String sourceMethod, Object[] params)
void
exiting(String sourceClass, String sourceMethod)
void
exiting(String sourceClass, String sourceMethod, Object result)
void
fine(String msg)
void
finer(String msg)
void
finest(String msg)
static PatchLogger
getAnonymousLogger()
static PatchLogger
getAnonymousLogger(String resourceBundleName)
static PatchLogger
getGlobal()
Level
getLevel()
static PatchLogger
getLogger(String name)
static PatchLogger
getLogger(String name, String resourceBundleName)
String
getName()
PatchLogger
getParent()
ResourceBundle
getResourceBundle()
String
getResourceBundleName()
void
info(String msg)
boolean
isLoggable(Level level)
void
log(Level level, String msg)
void
log(Level level, String msg, Object param1)
void
log(Level level, String msg, Object[] params)
void
log(Level level, String msg, Throwable thrown)
void
log(LogRecord record)
void
logp(Level level, String sourceClass, String sourceMethod, String msg)
void
logp(Level level, String sourceClass, String sourceMethod, String msg, Object param1)
void
logp(Level level, String sourceClass, String sourceMethod, String msg, Object[] params)
void
logp(Level level, String sourceClass, String sourceMethod, String msg, Throwable thrown)
void
logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg)
void
logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object param1)
void
logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object[] params)
void
logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Throwable thrown)
void
logrb(Level level, String sourceClass, String sourceMethod, ResourceBundle bundle, String msg, Object... params)
void
logrb(Level level, String sourceClass, String sourceMethod, ResourceBundle bundle, String msg, Throwable thrown)
void
logrb(Level level, ResourceBundle bundle, String msg, Object... params)
void
logrb(Level level, ResourceBundle bundle, String msg, Throwable thrown)
void
setLevel(Level newLevel)
void
setParent(PatchLogger parent)
void
setResourceBundle(ResourceBundle resourceBundle)
void
severe(String msg)
void
throwing(String sourceClass, String sourceMethod, Throwable thrown)
void
warning(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()
-
-