public class Logger extends Object
By default logging will occur using JUL (Java-Util-Logging). The logging configuration file (logging.properties)
used by JUL will taken from the default logging.properties in the JDK installation if no java.util.logging.config.file
system
property is set.
If you would prefer to use Log4J or SLF4J instead of JUL then you can set a system property called
vertx.logger-delegate-factory-class-name
to the class name of the delegate for your logging system.
For Log4J the value is io.vertx.core.logging.Log4jLogDelegateFactory
, for SLF4J the value
is io.vertx.core.logging.SLF4JLogDelegateFactory
. You will need to ensure whatever jar files
required by your favourite log framework are on your classpath.
Keep in mind that logging backends use different formats to represent replaceable tokens in parameterized messages. As a consequence, if you rely on parameterized logging methods, you won't be able to switch backends without changing your code.
Constructor and Description |
---|
Logger(LogDelegate delegate) |
Modifier and Type | Method and Description |
---|---|
void |
debug(Object message) |
void |
debug(Object message,
Object... objects) |
void |
debug(Object message,
Throwable t) |
void |
debug(Object message,
Throwable t,
Object... objects) |
void |
error(Object message) |
void |
error(Object message,
Object... objects) |
void |
error(Object message,
Throwable t) |
void |
error(Object message,
Throwable t,
Object... objects) |
void |
fatal(Object message) |
void |
fatal(Object message,
Throwable t) |
LogDelegate |
getDelegate() |
void |
info(Object message) |
void |
info(Object message,
Object... objects) |
void |
info(Object message,
Throwable t) |
void |
info(Object message,
Throwable t,
Object... objects) |
boolean |
isDebugEnabled() |
boolean |
isInfoEnabled() |
boolean |
isTraceEnabled() |
boolean |
isWarnEnabled() |
void |
trace(Object message) |
void |
trace(Object message,
Object... objects) |
void |
trace(Object message,
Throwable t) |
void |
trace(Object message,
Throwable t,
Object... objects) |
void |
warn(Object message) |
void |
warn(Object message,
Object... objects) |
void |
warn(Object message,
Throwable t) |
void |
warn(Object message,
Throwable t,
Object... objects) |
public Logger(LogDelegate delegate)
public boolean isWarnEnabled()
public boolean isInfoEnabled()
public boolean isDebugEnabled()
public boolean isTraceEnabled()
public void fatal(Object message)
public void error(Object message)
public void error(Object message, Object... objects)
UnsupportedOperationException
- if the logging backend does not support parameterized messagespublic void error(Object message, Throwable t, Object... objects)
UnsupportedOperationException
- if the logging backend does not support parameterized messagespublic void warn(Object message)
public void warn(Object message, Object... objects)
UnsupportedOperationException
- if the logging backend does not support parameterized messagespublic void warn(Object message, Throwable t, Object... objects)
UnsupportedOperationException
- if the logging backend does not support parameterized messagespublic void info(Object message)
public void info(Object message, Object... objects)
UnsupportedOperationException
- if the logging backend does not support parameterized messagespublic void info(Object message, Throwable t, Object... objects)
UnsupportedOperationException
- if the logging backend does not support parameterized messagespublic void debug(Object message)
public void debug(Object message, Object... objects)
UnsupportedOperationException
- if the logging backend does not support parameterized messagespublic void debug(Object message, Throwable t, Object... objects)
UnsupportedOperationException
- if the logging backend does not support parameterized messagespublic void trace(Object message)
public void trace(Object message, Object... objects)
UnsupportedOperationException
- if the logging backend does not support parameterized messagespublic void trace(Object message, Throwable t, Object... objects)
UnsupportedOperationException
- if the logging backend does not support parameterized messagespublic LogDelegate getDelegate()
Copyright © 2023 Eclipse. All rights reserved.