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

Matt Pavlovich edited comment on AMQ-4819 at 12/16/13 9:31 PM:
---------------------------------------------------------------

Looking for feedback on impl approach.. with SLF4j, there isn't a way to pass 
in the log level in a single line.. anyone have an approach that would allow us 
to avoid this mess:

{{quote}} 
 if(usage.getCheckLimitsLogLevel().equalsIgnoreCase("warn")) {
                LOG.warn(logMsg);
            } else if(usage.getCheckLimitsLogLevel().equalsIgnoreCase("error")) 
{
                LOG.error(logMsg);
            } else if(usage.getCheckLimitsLogLevel().equalsIgnoreCase("trace")) 
{
                LOG.trace(logMsg);              
            } else if(usage.getCheckLimitsLogLevel().equalsIgnoreCase("info")) {
                LOG.info(logMsg);
            }else if(usage.getCheckLimitsLogLevel().equalsIgnoreCase("fatal")) {
                LOG.error(logMsg);              
            } else if(usage.getCheckLimitsLogLevel().equalsIgnoreCase("debug")) 
{
                LOG.debug(logMsg);
            } else {
                LOG.warn("Invalid SystemUsage checkLimitsLogLevel: " + 
usage.getCheckLimitsLogLevel());
                LOG.warn(logMsg);
            }
{{quote}}


was (Author: mattrpav):
Looking for feedback on impl approach.. with SLF4j, there isn't a way to pass 
in the log level in a single line.. anyone have an approach that would allow us 
to avoid this mess:

{{  if(usage.getCheckLimitsLogLevel().equalsIgnoreCase("warn")) {
                LOG.warn(logMsg);
            } else if(usage.getCheckLimitsLogLevel().equalsIgnoreCase("error")) 
{
                LOG.error(logMsg);
            } else if(usage.getCheckLimitsLogLevel().equalsIgnoreCase("trace")) 
{
                LOG.trace(logMsg);              
            } else if(usage.getCheckLimitsLogLevel().equalsIgnoreCase("info")) {
                LOG.info(logMsg);
            }else if(usage.getCheckLimitsLogLevel().equalsIgnoreCase("fatal")) {
                LOG.error(logMsg);              
            } else if(usage.getCheckLimitsLogLevel().equalsIgnoreCase("debug")) 
{
                LOG.debug(logMsg);
            } else {
                LOG.warn("Invalid SystemUsage checkLimitsLogLevel: " + 
usage.getCheckLimitsLogLevel());
                LOG.warn(logMsg);
            }
}}

> Reducing memory usage should log at INFO/WARN level instead of ERROR
> --------------------------------------------------------------------
>
>                 Key: AMQ-4819
>                 URL: https://issues.apache.org/jira/browse/AMQ-4819
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 5.9.0
>            Reporter: Claus Ibsen
>            Assignee: Matt Pavlovich
>            Priority: Minor
>             Fix For: 5.10.0
>
>
> For example when using unit tests we will see. There is other limits that is 
> being logged as well such as when disk space is also less than expected. That 
> is logged at INFO level AFAIR
> 2013-10-22 10:24:44,002 [main           ] ERROR BrokerService                 
>  - Memory Usage for the Broker (1024 mb) is more than the maximum available 
> for the JVM: 156 mb - resetting to 70% of maximum available: 109 mb
> I suggest to make this logging level INFO or maybe at WARN?



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Reply via email to