Class LoggingManager
java.lang.Object
org.apache.jorphan.logging.LoggingManager
Manages JMeter logging
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddLogTargetToRootLogger(LogTarget[] logTargets) Add logTargets to root logger FIXME What's the clean way to add a LogTarget afterwards ?static LoggergetLoggerFor(String category) Get the Logger for a class.static LoggerGet the Logger for a class - no argument needed because the calling class name is derived automatically from the call stack.static LoggergetLoggerForShortName(String category) Get the Logger for a class.static voidinitializeLogging(Properties properties) Initialise the logging system from the Jmeter properties.static StringremovePrefix(String name) Removes the standard prefix, i.e.static voidsetLoggingLevels(Properties appProperties) Handle LOG_PRIORITY.category=priority and LOG_FILE.category=file_name properties.static voidstatic voidsetPriority(String priority, String category) Set the logging priority for a category.static voidsetPriority(Priority priority) Set the default logging priority.static voidsetPriority(Priority priority, String category) Set the logging priority for a category.static voidsetPriorityFullName(String priority, String fullName) Set the logging priority for a category.static voidSet the logging target for a category.
-
Field Details
-
DEFAULT_PATTERN
- See Also:
-
LOG_FILE
- See Also:
-
LOG_PRIORITY
- See Also:
-
-
Method Details
-
initializeLogging
Initialise the logging system from the Jmeter properties. Logkit loggers inherit from their parents. Normally the jmeter properties file defines a single log file, so set this as the default from "log_file", default "jmeter.log" The default priority is set from "log_level", with a default of INFO- Parameters:
properties-Propertiesto be used for initialization
-
setLoggingLevels
Handle LOG_PRIORITY.category=priority and LOG_FILE.category=file_name properties. If the prefix is detected, then remove it to get the category.- Parameters:
appProperties-Propertiesthat contain theLOG_PRIORITYandLOG_FILEprefixed entries
-
removePrefix
-
getLoggerForClass
public static Logger getLoggerForClass()Get the Logger for a class - no argument needed because the calling class name is derived automatically from the call stack.- Returns:
- Logger
-
getLoggerFor
Get the Logger for a class.- Parameters:
category- - the full name of the logger category- Returns:
- Logger
-
getLoggerForShortName
Get the Logger for a class.- Parameters:
category- - the full name of the logger category, this will have the prefix removed.- Returns:
- Logger
-
setPriority
-
setPriorityFullName
-
setPriority
Set the logging priority for a category.- Parameters:
priority- - e.g. Priority.DEBUGcategory- - string containing the category
-
setPriority
-
setPriority
public static void setPriority(Priority priority) Set the default logging priority.- Parameters:
priority- e.g. Priority.DEBUG
-
setTarget
Set the logging target for a category.- Parameters:
target- the LogTargetcategory- the category name
-
addLogTargetToRootLogger
public static void addLogTargetToRootLogger(LogTarget[] logTargets) Add logTargets to root logger FIXME What's the clean way to add a LogTarget afterwards ?- Parameters:
logTargets- LogTarget array
-