org.apache.jorphan.logging
Class LoggingManager
public final class LoggingManager
Manages JMeter logging
static LoggingManager | getLogManager()
|
static Logger | getLoggerFor(String category) - Get the Logger for a class.
|
static Logger | getLoggerForClass() - Get the Logger for a class - no argument needed because the calling class
name is derived automatically from the call stack.
|
static Logger | getLoggerForShortName(String category) - Get the Logger for a class.
|
static void | initializeLogging(Properties properties) - Initialise the logging system from the Jmeter properties.
|
static String | removePrefix(String name) - Removes the standard prefix, i.e.
|
static void | setLoggingLevels(Properties appProperties) - Handle LOG_PRIORITY.category=priority and LOG_FILE.category=file_name
properties.
|
static void | setPriority(Priority priority) - Set the default logging priority.
|
static void | setPriority(Priority priority, String category) - Set the logging priority for a category.
|
static void | setPriority(String p)
|
static void | setPriority(String priority, String category) - Set the logging priority for a category.
|
static void | setPriorityFullName(String priority, String fullName) - Set the logging priority for a category.
|
static void | setTarget(LogTarget target, String category) - Set the logging target for a category.
|
static void | setTarget(Writer targetFile) - Sets the default log target from the parameter.
|
LOG_FILE
public static final String LOG_FILE
LOG_PRIORITY
public static final String LOG_PRIORITY
getLoggerFor
public static Logger getLoggerFor(String category)
Get the Logger for a class.
category
- - the full name of the logger category
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.
getLoggerForShortName
public static Logger getLoggerForShortName(String category)
Get the Logger for a class.
category
- - the full name of the logger category, this will have the prefix removed.
initializeLogging
public static void initializeLogging(Properties properties)
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
removePrefix
public static String removePrefix(String name)
Removes the standard prefix, i.e. "org.apache.".
name
- from which to remove the prefix
- the name with the prefix removed
setLoggingLevels
public static void setLoggingLevels(Properties appProperties)
Handle LOG_PRIORITY.category=priority and LOG_FILE.category=file_name
properties. If the prefix is detected, then remove it to get the
category.
setPriority
public static void setPriority(Priority priority)
Set the default logging priority.
priority
- e.g. Priority.DEBUG
setPriority
public static void setPriority(Priority priority,
String category)
Set the logging priority for a category.
priority
- - e.g. Priority.DEBUGcategory
- - string containing the category
setPriority
public static void setPriority(String p)
setPriority
public static void setPriority(String priority,
String category)
Set the logging priority for a category.
priority
- - string containing the priority name, e.g. "INFO", "WARN", "DEBUG", "FATAL_ERROR"category
- - string containing the category
setPriorityFullName
public static void setPriorityFullName(String priority,
String fullName)
Set the logging priority for a category.
priority
- - priority, e.g. DEBUG, INFOfullName
- - e.g. org.apache.jmeter.etc, will have the prefix removed.
setTarget
public static void setTarget(LogTarget target,
String category)
Set the logging target for a category.
target
- the LogTargetcategory
- the category name
setTarget
public static void setTarget(Writer targetFile)
Sets the default log target from the parameter. The existing target is
first closed if necessary.
Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.