You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Steve Wang (JIRA)" <ji...@apache.org> on 2015/06/12 20:26:01 UTC

[jira] [Resolved] (CASSANDRA-5322) Make dtest logging more granular

     [ https://issues.apache.org/jira/browse/CASSANDRA-5322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Wang resolved CASSANDRA-5322.
-----------------------------------
       Resolution: Fixed
    Fix Version/s:     (was: 3.x)
                   2.2.x
                   2.1.x
         Reviewer: Philip Thompson
    Reproduced In: 2.1.5

Modified ccmlib/cluster.py, ccmlib/common.py, and cassandra-dtest/dtest.py. 

I modified the dtest environment variables DEBUG and TRACE so that they could not only accept true/yes and false/no, but also names of C* classes (can add multiple by separating them with a colon). I did this using three functions: var_debug, var_trace, and modify_log. The first two change the log_level of the cluster for a specific class (If it's that is the case), and modify_log calls all the potential changes to the log_level's all at once. 

In cluster.py, I modified the add and set_log_level functions, and also added two global arrays, _debug and _trace. The two global variables serve to keep track of what classes have the respective log levels. In the set_log_level function, we check if there is a class_name being inputted, and if there is, we make sure it's not already being called. We then append the class to the respective global array, and then change the log_level on the node level. In the add function, I added a feature that whenever a node is added, it'll automatically take in the settings already set forth for class logging levels. 

Finally, in common.py, I modified the replaces_or_add_into_file_tail function. Before, all additional modifications would be written on the very last line of the file after the closing tag, which means it wasn't being read. This includes modifications to the log level. I changed it so that it would be added before the closing tag.

> Make dtest logging more granular 
> ---------------------------------
>
>                 Key: CASSANDRA-5322
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5322
>             Project: Cassandra
>          Issue Type: Test
>            Reporter: Ryan McGuire
>            Assignee: Steve Wang
>             Fix For: 2.1.x, 2.2.x
>
>
> From Brandon: We need a way (might need to go in ccm, I haven't looked) to just set one class to DEBUG or TRACE, like we'd do in conf/log4-server.properties but with an env var preferably, so I can control it via buildbot, since it's better at reproducing some issues than I am sometimes, but I don't want to run the full hammer debug all the time. Also, a way to set Tester.allow_log_errors to false via an env var, since sometimes there's an error there that takes a while to fix but is cosmetic, and in the meantime I want to catch new failures so we don't fall behind.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)