public class Logger extends Object
<p>This class allows us to isolate all our logging dependencies in one place. It also allows us to have zero runtime 3rd party logging jar dependencies, since we default to JUL by default.</p>
<p>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. The vertx-java / vertx-ruby / etc
scripts set java.util.logging.config.file
to point at the logging.properties
in the vertx distro install directory. This in turn configures vertx to log to a file in a directory called
vertx-logs in the users home directory.</p>
<p>If you would prefer to use Log4J or SLF4J instead of JUL then you can set a system property called
io.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.impl.Log4JLogDelegateFactory
, for SLF4J the value
is io.vertx.core.logging.impl.SLF4JLogDelegateFactory
. You will need to ensure whatever jar files
required by your favourite log framework are on your classpath.</p>
Constructor and Description |
---|
Logger(LogDelegate delegate) |
Modifier and Type | Method and Description |
---|---|
void |
debug(Object message) |
void |
debug(Object message,
Throwable t) |
void |
error(Object message) |
void |
error(Object message,
Throwable t) |
void |
fatal(Object message) |
void |
fatal(Object message,
Throwable t) |
void |
info(Object message) |
void |
info(Object message,
Throwable t) |
boolean |
isDebugEnabled() |
boolean |
isInfoEnabled() |
boolean |
isTraceEnabled() |
void |
trace(Object message) |
void |
trace(Object message,
Throwable t) |
void |
warn(Object message) |
void |
warn(Object message,
Throwable t) |
public Logger(LogDelegate delegate)
public boolean isInfoEnabled()
public boolean isDebugEnabled()
public boolean isTraceEnabled()
public void fatal(Object message)
public void error(Object message)
public void warn(Object message)
public void info(Object message)
public void debug(Object message)
public void trace(Object message)
Copyright © 2014. All Rights Reserved.