Class Log4j2LevelAdjuster
java.lang.Object
org.springframework.integration.test.rule.Log4j2LevelAdjuster
- All Implemented Interfaces:
org.junit.rules.MethodRule
@Deprecated(since="7.0",
forRemoval=true)
public final class Log4j2LevelAdjuster
extends Object
implements org.junit.rules.MethodRule
Deprecated, for removal: This API element is subject to removal in a future version.
A JUnit method
Rule
that changes the Log4J 2 logger level for a set of classes
or packages while a test method is running. Useful for performance or scalability tests
where we don't want to generate a large log in a tight inner loop, or
enabling debug logging for a test case.- Since:
- 5.0.1
- Author:
- Artem Bilan, Gary Russell, Jiandong Ma
-
Method Summary
Modifier and TypeMethodDescriptionorg.junit.runners.model.Statement
apply
(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod method, Object target) Deprecated, for removal: This API element is subject to removal in a future version.categories
(boolean merge, String... categories) Deprecated, for removal: This API element is subject to removal in a future version.Specify the categories for logging level adjusting configured before.categories
(String... categoriesToAdjust) Deprecated, for removal: This API element is subject to removal in a future version.Specify the categories for logging level adjusting configured before.Deprecated, for removal: This API element is subject to removal in a future version.Specify the classes for logging level adjusting configured before.Deprecated, for removal: This API element is subject to removal in a future version.Specify the classes for logging level adjusting configured before.static Log4j2LevelAdjuster
debug()
Deprecated, for removal: This API element is subject to removal in a future version.The factory to produce Log4j2LevelAdjuster instances forLevel.DEBUG
logging with theorg.springframework.integration
as default category.static Log4j2LevelAdjuster
forLevel
(org.apache.logging.log4j.Level level) Deprecated, for removal: This API element is subject to removal in a future version.The factory to produce Log4j2LevelAdjuster instances for arbitrary loggingLevel
with theorg.springframework.integration
as default category.static Log4j2LevelAdjuster
info()
Deprecated, for removal: This API element is subject to removal in a future version.The factory to produce Log4j2LevelAdjuster instances forLevel.INFO
logging with theorg.springframework.integration
as default category.static Log4j2LevelAdjuster
trace()
Deprecated, for removal: This API element is subject to removal in a future version.The factory to produce Log4j2LevelAdjuster instances forLevel.TRACE
logging with theorg.springframework.integration
as default category.
-
Method Details
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod method, Object target) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
apply
in interfaceorg.junit.rules.MethodRule
-
classes
Deprecated, for removal: This API element is subject to removal in a future version.Specify the classes for logging level adjusting configured before. A new copy Log4j2LevelAdjuster instance is produced by this method. The provided classes parameter overrides existing value in theclasses
.- Parameters:
clazzes
- the classes to use for logging level adjusting- Returns:
- a Log4j2LevelAdjuster copy with the provided classes
-
classes
Deprecated, for removal: This API element is subject to removal in a future version.Specify the classes for logging level adjusting configured before. A new copy Log4j2LevelAdjuster instance is produced by this method. The provided classes parameter can be merged with existing value in theclasses
.- Parameters:
merge
- to merge or not with previously configuredclasses
classesToAdjust
- the classes to use for logging level adjusting- Returns:
- a Log4j2LevelAdjuster copy with the provided classes
- Since:
- 5.0.2
-
categories
Deprecated, for removal: This API element is subject to removal in a future version.Specify the categories for logging level adjusting configured before. A new copy Log4j2LevelAdjuster instance is produced by this method. The provided categories parameter overrides existing value in thecategories
.- Parameters:
categoriesToAdjust
- the categories to use for logging level adjusting- Returns:
- a Log4j2LevelAdjuster copy with the provided categories
-
categories
Deprecated, for removal: This API element is subject to removal in a future version.Specify the categories for logging level adjusting configured before. A new copy Log4j2LevelAdjuster instance is produced by this method. The provided categories parameter can be merged with existing value in thecategories
.- Parameters:
merge
- to merge or not with previously configuredcategories
categories
- the categories to use for logging level adjusting- Returns:
- a Log4j2LevelAdjuster copy with the provided categories
- Since:
- 5.0.2
-
trace
Deprecated, for removal: This API element is subject to removal in a future version.The factory to produce Log4j2LevelAdjuster instances forLevel.TRACE
logging with theorg.springframework.integration
as default category.- Returns:
- the Log4j2LevelAdjuster instance
-
debug
Deprecated, for removal: This API element is subject to removal in a future version.The factory to produce Log4j2LevelAdjuster instances forLevel.DEBUG
logging with theorg.springframework.integration
as default category.- Returns:
- the Log4j2LevelAdjuster instance
-
info
Deprecated, for removal: This API element is subject to removal in a future version.The factory to produce Log4j2LevelAdjuster instances forLevel.INFO
logging with theorg.springframework.integration
as default category.- Returns:
- the Log4j2LevelAdjuster instance
-
forLevel
Deprecated, for removal: This API element is subject to removal in a future version.The factory to produce Log4j2LevelAdjuster instances for arbitrary loggingLevel
with theorg.springframework.integration
as default category.- Parameters:
level
- theLevel
to use for logging- Returns:
- the Log4j2LevelAdjuster instance
-
LogLevels