You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metron.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/11/07 15:29:58 UTC

[jira] [Commented] (METRON-541) Set log levels for Metron components

    [ https://issues.apache.org/jira/browse/METRON-541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15644486#comment-15644486 ] 

ASF GitHub Bot commented on METRON-541:
---------------------------------------

GitHub user merrimanr opened a pull request:

    https://github.com/apache/incubator-metron/pull/347

    METRON-541: Set log levels for Metron components

    This PR accomplishes primarily 2 things:  sets the log level for all components (and their dependencies) to ERROR and suppresses ERROR log statements in tests for cases where an exception is expected.  Ideally a combination of this PR and #344 will make the output logs in Travis much cleaner.
    
    The approach for setting the log level is to exclude all transitive SJF4J bindings and instead declare the log4j binding in the metron-platform and metron-analytics poms (would top level be better?).  There is some code that uses log4j instead SLF4J so this binding seemed appropriate.  Now there are no more SLF4J warnings and the log level for every component can be configured in test/resources/log4j.properties.  It is currently set to ERROR by default but do we want to add different log files for different profiles (dev, travis, prod, etc)?
    
    The approach for suppressing expected ERROR log messages is to temporarily change the log level to SEVERE/FATAL during a test that generates an ERROR message and change it back right after the test (or line within the test) has executed.  A couple of methods to programmatically change the log level at runtime was added to the UnitTestHelper class.  
    
    There were a few test cases where an exception was incorrectly thrown so I fixed those (BulkMessageWriterBoltTest.java and ParserBoltTest.java).
    
    There are a lot of different ways to do logging so I'm expecting the community will have opinions on what the right approach is for us.  I have tested this with unit/integration tests and will test with vagrant once we get closer to a consensus.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/merrimanr/incubator-metron METRON-541

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-metron/pull/347.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #347
    
----

----


> Set log levels for Metron components
> ------------------------------------
>
>                 Key: METRON-541
>                 URL: https://issues.apache.org/jira/browse/METRON-541
>             Project: Metron
>          Issue Type: Bug
>            Reporter: Ryan Merriman
>            Assignee: Ryan Merriman
>            Priority: Critical
>
> When running unit or integration tests the log output is very verbose.  This makes it difficult to determine what the problem is when something goes wrong and also intermittently causes Travis to hit it's output threshold and fail.
> The log levels should be consistent across all components and there should be logging profiles available for different scenarios.  



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