@ManagedObject(value="Jetty StdErr Logging Implementation")
public class StdErrLog
extends org.eclipse.jetty.util.log.AbstractLogger
A Jetty Logger that sends all logs to STDERR (System.err) with basic formatting.
Supports named loggers, and properties based configuration.
Configuration Properties:
org.eclipse.jetty should log at level WARN.| 限定符和类型 | 字段和说明 |
|---|---|
protected String |
_abbrevname |
| 构造器和说明 |
|---|
StdErrLog()
Construct an anonymous StdErrLog (no name).
|
StdErrLog(String name)
Construct a named StdErrLog using the
Log defined properties |
StdErrLog(String name,
Properties props)
Construct a named Logger using the provided properties to configure logger.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
debug(String msg,
long arg) |
void |
debug(String msg,
Object... args) |
void |
debug(String msg,
Throwable thrown) |
void |
debug(Throwable thrown) |
protected void |
format(StringBuilder buffer,
Throwable thrown) |
protected void |
format(StringBuilder buffer,
Throwable thrown,
String indent) |
int |
getLevel() |
static StdErrLog |
getLogger(Class<?> clazz)
Obtain a StdErrLog reference for the specified class, a convenience method used most often during testing to allow for control over a specific logger.
|
static int |
getLoggingLevel(Properties props,
String name) |
String |
getName() |
void |
ignore(Throwable ignored) |
void |
info(String msg,
Object... args) |
void |
info(String msg,
Throwable thrown) |
void |
info(Throwable thrown) |
boolean |
isDebugEnabled() |
boolean |
isHideStacks() |
boolean |
isPrintLongNames() |
boolean |
isSource()
Is the source of a log, logged
|
protected org.eclipse.jetty.util.log.Logger |
newLogger(String fullname)
Create a Child Logger of this Logger.
|
void |
setDebugEnabled(boolean enabled)
Legacy interface where a programmatic configuration of the logger level
is done as a wholesale approach.
|
void |
setHideStacks(boolean hideStacks) |
void |
setLevel(int level)
Set the level for this logger.
|
void |
setPrintLongNames(boolean printLongNames) |
void |
setSource(boolean source)
Set if a log source is logged.
|
void |
setStdErrStream(PrintStream stream) |
static void |
setTagPad(int pad) |
String |
toString() |
void |
warn(String msg,
Object... args) |
void |
warn(String msg,
Throwable thrown) |
void |
warn(Throwable thrown) |
protected final String _abbrevname
public StdErrLog()
NOTE: Discouraged usage!
public StdErrLog(String name)
Log defined propertiesname - the name of the loggerpublic StdErrLog(String name, Properties props)
name - the name of the loggerprops - the configuration propertiespublic static void setTagPad(int pad)
public static int getLoggingLevel(Properties props, String name)
public static StdErrLog getLogger(Class<?> clazz)
Must be actively using StdErrLog as the Logger implementation.
clazz - the Class reference for the logger to use.RuntimeException - if StdErrLog is not the active Logger implementation.public String getName()
public void setPrintLongNames(boolean printLongNames)
public boolean isPrintLongNames()
public boolean isHideStacks()
public void setHideStacks(boolean hideStacks)
public boolean isSource()
public void setSource(boolean source)
source - true if the class, method, file and line number of a log is logged.public void warn(Throwable thrown)
public void info(Throwable thrown)
@ManagedAttribute(value="is debug enabled for root logger Log.LOG") public boolean isDebugEnabled()
public void setDebugEnabled(boolean enabled)
public int getLevel()
public void setLevel(int level)
Available values (AbstractLogger.LEVEL_ALL, AbstractLogger.LEVEL_DEBUG, AbstractLogger.LEVEL_INFO,
AbstractLogger.LEVEL_WARN)
level - the level to set the logger topublic void setStdErrStream(PrintStream stream)
public void debug(String msg, long arg)
debug 在接口中 org.eclipse.jetty.util.log.Loggerdebug 在类中 org.eclipse.jetty.util.log.AbstractLoggerpublic void debug(Throwable thrown)
protected void format(StringBuilder buffer, Throwable thrown)
protected void format(StringBuilder buffer, Throwable thrown, String indent)
protected org.eclipse.jetty.util.log.Logger newLogger(String fullname)
newLogger 在类中 org.eclipse.jetty.util.log.AbstractLoggerpublic void ignore(Throwable ignored)
Copyright © 2019. All rights reserved.