[
https://issues.apache.org/jira/browse/HDFS-11977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16455112#comment-16455112
]
Hudson commented on HDFS-11977:
-------------------------------
SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #14070 (See
[https://builds.apache.org/job/Hadoop-trunk-Commit/14070/])
HDFS-11977. Ozone: cannot enable test debug/trace log. Contributed by (omalley:
rev 18ddec614463525f75c4208006911a5c6716e5cc)
* (edit) hadoop-hdfs-project/hadoop-hdfs/src/test/resources/log4j.properties
> Ozone: cannot enable test debug/trace log
> -----------------------------------------
>
> Key: HDFS-11977
> URL: https://issues.apache.org/jira/browse/HDFS-11977
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: ozone, test
> Reporter: Tsz Wo Nicholas Sze
> Assignee: Tsz Wo Nicholas Sze
> Priority: Minor
> Fix For: HDFS-7240
>
> Attachments: HDFS-11977-HDFS-7240.20170615.patch
>
>
> Interestingly, the test debug/trace logs are not printed for Ozone classes
> even if we invoke GenericTestUtils.setLogLevel(log, Level.ALL). Other
> classes such as Object do not have such problem. Here is a test:
> {code}
> @Test
> public void testLogLevel() throws Exception {
> runTestLogLevel(StorageContainerManager.class);
> runTestLogLevel(Object.class);
> }
> static void runTestLogLevel(Class<?> clazz) throws Exception {
> final Logger log = LoggerFactory.getLogger(clazz);
> GenericTestUtils.setLogLevel(log, Level.ALL);
> log.trace(clazz.getSimpleName() + " trace log");
> log.debug(clazz.getSimpleName() + " debug log");
> log.info(clazz.getSimpleName() + " info log");
> log.warn(clazz.getSimpleName() + " warn log");
> log.error(clazz.getSimpleName() + " error log");
> }
> {code}
> Output:
> {code}
> 2017-06-15 00:19:07,133 [Thread-0] INFO - StorageContainerManager info
> log
> 2017-06-15 00:19:07,135 [Thread-0] WARN - StorageContainerManager warn
> log
> 2017-06-15 00:19:07,135 [Thread-0] ERROR - StorageContainerManager error
> log
> 2017-06-15 00:19:07,135 [Thread-0] TRACE
> lang.Object(TestOzoneContainer.java:runTestLogLevel(64)) - Object trace log
> 2017-06-15 00:19:07,135 [Thread-0] DEBUG
> lang.Object(TestOzoneContainer.java:runTestLogLevel(65)) - Object debug log
> 2017-06-15 00:19:07,135 [Thread-0] INFO
> lang.Object(TestOzoneContainer.java:runTestLogLevel(66)) - Object info log
> 2017-06-15 00:19:07,135 [Thread-0] WARN
> lang.Object(TestOzoneContainer.java:runTestLogLevel(67)) - Object warn log
> 2017-06-15 00:19:07,135 [Thread-0] ERROR
> lang.Object(TestOzoneContainer.java:runTestLogLevel(68)) - Object error log
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]