qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robbie Gemmell <robbie.gemm...@gmail.com>
Subject Re: svn commit: r992330 - in /qpid/trunk/qpid/java: broker/src/main/java/org/apache/qpid/server/logging/messages/ broker/src/main/java/org/apache/qpid/server/management/ broker/src/test/java/org/apache/qpid/server/logging/messages/ systests/src/main/
Date Mon, 06 Sep 2010 10:11:41 GMT
Agreed, I have updated it to move the string out to the property file.

Robbie

On 6 September 2010 02:41, Martin Ritchie <ritchiem@apache.org> wrote:
> Robbie,
> Embedding logging strings in the code is one of the reasons we
> introduced the logging format, as they are hard to identify for
> operations.
>
> If you must log additional information on the management startup log
> I'd suggest either a new log statement or push the string literal in
> to the property file:
> READY = MNG-1004 : Ready[ : Using the platform JMX Agent]
>
> This keeps it easy to provide details to operate on what to expect but
> also allows easy localisation.
>
> Regards
>
> Martin
>
> On 3 September 2010 16:35,  <robbie@apache.org> wrote:
>> Author: robbie
>> Date: Fri Sep  3 15:35:44 2010
>> New Revision: 992330
>>
>> URL: http://svn.apache.org/viewvc?rev=992330&view=rev
>> Log:
>> QPID-2843: Ensure that a MNG-1004 message is logged when using the platform agent
(and indicates use of the platform agent), merge the BRK-1004 message text with the previously
used stdout startup log message.
>>
>> Modified:
>>    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties
>>    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsole_logmessages.properties
>>    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
>>    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessagesTest.java
>>    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java
>>
>> Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties
>> URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties?rev=992330&r1=992329&r2=992330&view=diff
>> ==============================================================================
>> --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties
(original)
>> +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties
Fri Sep  3 15:35:44 2010
>> @@ -27,7 +27,7 @@ LISTENING = BRK-1002 : Starting : Listen
>>  # 0 - Transport
>>  # 1 - Port
>>  SHUTTING_DOWN = BRK-1003 : Shuting down : {0} port {1,number,#}
>> -READY = BRK-1004 : Ready
>> +READY = BRK-1004 : Qpid Broker Ready
>>  STOPPED = BRK-1005 : Stopped
>>  # 0 - path
>>  CONFIG = BRK-1006 : Using configuration : {0}
>>
>> Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsole_logmessages.properties
>> URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsole_logmessages.properties?rev=992330&r1=992329&r2=992330&view=diff
>> ==============================================================================
>> --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsole_logmessages.properties
(original)
>> +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsole_logmessages.properties
Fri Sep  3 15:35:44 2010
>> @@ -25,7 +25,7 @@ LISTENING = MNG-1002 : Starting : {0} :
>>  # 0 - Service
>>  # 1 - Port
>>  SHUTTING_DOWN = MNG-1003 : Shutting down : {0} : port {1,number,#}
>> -READY = MNG-1004 : Ready
>> +READY = MNG-1004 : Ready[ : {0}]
>>  STOPPED = MNG-1005 : Stopped
>>  # 0 - Path
>>  SSL_KEYSTORE = MNG-1006 : Using SSL Keystore : {0}
>>
>> Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
>> URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java?rev=992330&r1=992329&r2=992330&view=diff
>> ==============================================================================
>> --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
(original)
>> +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
Fri Sep  3 15:35:44 2010
>> @@ -106,7 +106,7 @@ public class JMXManagedObjectRegistry im
>>         //check if system properties are set to use the JVM's out-of-the-box JMXAgent
>>         if (areOutOfTheBoxJMXOptionsSet())
>>         {
>> -            _log.warn("JMX: Using the out of the box JMX Agent");
>> +            CurrentActor.get().message(ManagementConsoleMessages.READY("Using the
platform JMX Agent", true));
>>             return;
>>         }
>>
>> @@ -314,7 +314,7 @@ public class JMXManagedObjectRegistry im
>>         String connectorServer = (sslEnabled ? "SSL " : "") + "JMX RMIConnectorServer";
>>         CurrentActor.get().message(ManagementConsoleMessages.LISTENING(connectorServer,
port + PORT_EXPORT_OFFSET));
>>
>> -        CurrentActor.get().message(ManagementConsoleMessages.READY());
>> +        CurrentActor.get().message(ManagementConsoleMessages.READY("", false));
>>     }
>>
>>     /*
>>
>> Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessagesTest.java
>> URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessagesTest.java?rev=992330&r1=992329&r2=992330&view=diff
>> ==============================================================================
>> --- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessagesTest.java
(original)
>> +++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessagesTest.java
Fri Sep  3 15:35:44 2010
>> @@ -65,12 +65,21 @@ public class ManagementConsoleMessagesTe
>>
>>     public void testManagementReady()
>>     {
>> -        _logMessage = ManagementConsoleMessages.READY();
>> +        _logMessage = ManagementConsoleMessages.READY("",false);
>>         List<Object> log = performLog();
>>
>>         String[] expected = {"Ready"};
>>
>>         validateLogMessage(log, "MNG-1004", expected);
>> +
>> +        _logger.clearLogMessages();
>> +
>> +        _logMessage = ManagementConsoleMessages.READY("Info",true);
>> +        log = performLog();
>> +
>> +        expected = new String[]{"Ready : Info"};
>> +
>> +        validateLogMessage(log, "MNG-1004", expected);
>>     }
>>
>>     public void testManagementStopped()
>>
>> Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java
>> URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java?rev=992330&r1=992329&r2=992330&view=diff
>> ==============================================================================
>> --- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java
(original)
>> +++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java
Fri Sep  3 15:35:44 2010
>> @@ -601,7 +601,7 @@ public class BrokerLoggingTest extends A
>>      * No input, all successful broker startups will show BRK-1004 messages.
>>      * Output:
>>      *
>> -     * 2009-07-09 15:50:20 +0100 MESSAGE BRK-1004 : Ready
>> +     * 2009-07-09 15:50:20 +0100 MESSAGE BRK-1004 : Qpid Broker Ready
>>      *
>>      * Validation Steps:
>>      *
>> @@ -659,7 +659,7 @@ public class BrokerLoggingTest extends A
>>                     validateMessageID(TESTID, log);
>>
>>                     //2
>> -                    assertEquals("Ready message not present", "Ready", getMessageString(log));
>> +                    assertEquals("Ready message not present", "Qpid Broker Ready",
getMessageString(log));
>>
>>                     //There will be 2 copies of the startup message (one via SystemOut,
and one via Log4J)
>>                     assertEquals("Unexpected ready message count",
>>
>>
>>
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:commits-subscribe@qpid.apache.org
>>
>>
>
>
>
> --
> Martin Ritchie
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Mime
View raw message