Package ratpack.dropwizard.metrics
Class Slf4jConfig
- java.lang.Object
-
- ratpack.dropwizard.metrics.ReporterConfigSupport<T>
-
- ratpack.dropwizard.metrics.ScheduledReporterConfigSupport<Slf4jConfig>
-
- ratpack.dropwizard.metrics.Slf4jConfig
-
public class Slf4jConfig extends ScheduledReporterConfigSupport<Slf4jConfig>
-
-
Constructor Summary
Constructors Constructor Description Slf4jConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Slf4jConfig
durationUnit(TimeUnit durationUnit)
Convert durations to the given time unit.TimeUnit
getDurationUnit()
The state of the duration time unit.org.slf4j.Logger
getLogger()
The state of the logger.com.codahale.metrics.Slf4jReporter.LoggingLevel
getLogLevel()
The state of the logging level.org.slf4j.Marker
getMarker()
The state of the marker.String
getPrefix()
The logger prefix.TimeUnit
getRateUnit()
The state of the rate time unit.Slf4jConfig
logger(org.slf4j.Logger logger)
Log metrics to the given logger.Slf4jConfig
logLevel(com.codahale.metrics.Slf4jReporter.LoggingLevel logLevel)
Use Logging Level when reporting.Slf4jConfig
marker(org.slf4j.Marker marker)
Mark all logged metrics with the given marker.Slf4jConfig
prefix(String prefix)
Prefix all metric names with the given string.Slf4jConfig
rateUnit(TimeUnit rateUnit)
Convert rates to the given time unit.-
Methods inherited from class ratpack.dropwizard.metrics.ScheduledReporterConfigSupport
getReporterInterval, reporterInterval
-
Methods inherited from class ratpack.dropwizard.metrics.ReporterConfigSupport
enable, excludeFilter, getExcludeFilter, getIncludeFilter, includeFilter, isEnabled
-
-
-
-
Method Detail
-
getMarker
public org.slf4j.Marker getMarker()
The state of the marker.- Returns:
- the marker instance
-
marker
public Slf4jConfig marker(org.slf4j.Marker marker)
Mark all logged metrics with the given marker.- Parameters:
marker
- an SLF4JMarker
- Returns:
this
-
getPrefix
public String getPrefix()
The logger prefix.- Returns:
- the prefix text
-
prefix
public Slf4jConfig prefix(String prefix)
Prefix all metric names with the given string.- Parameters:
prefix
- the prefix for all metric names- Returns:
this
-
getDurationUnit
public TimeUnit getDurationUnit()
The state of the duration time unit.- Returns:
- the duration unit instance
-
durationUnit
public Slf4jConfig durationUnit(TimeUnit durationUnit)
Convert durations to the given time unit.- Parameters:
durationUnit
- a unit of time- Returns:
this
-
getRateUnit
public TimeUnit getRateUnit()
The state of the rate time unit.- Returns:
- the rate unit instance
-
rateUnit
public Slf4jConfig rateUnit(TimeUnit rateUnit)
Convert rates to the given time unit.- Parameters:
rateUnit
- a unit of time- Returns:
this
-
getLogLevel
public com.codahale.metrics.Slf4jReporter.LoggingLevel getLogLevel()
The state of the logging level.- Returns:
- the log level instance
-
logLevel
public Slf4jConfig logLevel(com.codahale.metrics.Slf4jReporter.LoggingLevel logLevel)
Use Logging Level when reporting.- Parameters:
logLevel
- a (@link LoggingLevel}- Returns:
this
-
getLogger
public org.slf4j.Logger getLogger()
The state of the logger.- Returns:
- the logger instance
-
logger
public Slf4jConfig logger(org.slf4j.Logger logger)
Log metrics to the given logger.- Parameters:
logger
- an SLF4JLogger
- Returns:
this
-
-