shafreenAnfar opened a new pull request #24: Add an improvement to log-mediator
URL: https://github.com/apache/synapse/pull/24
 
 
   Consider the below Proxy service in which I have configured the log-mediator 
to print logs only when the category is set to DEBUG. However, there is no way 
to start the server with log-mediator debug logs enabled. 
   
   Only way to print the property values inside the log mediator is by 
configuring debug mode for the log -mediator class in the log4j.properties. But 
this is wrong because aforementioned configuration is there for the implementer 
of log-mediator but not for the synapse user.
   
   ```xml
    <proxy xmlns="http://ws.apache.org/ns/synapse";
          name="test"
          transports="http,https"
          statistics="disable"
          trace="disable"
          startOnLoad="true">
      <target>
         <inSequence>
            <log category="DEBUG">
               <property name="someproperty" value="somevalue"/>
            </log>
            <respond/>
         </inSequence>
      </target>
      <description/>
   </proxy>
   ```
   Above issue is fixed with this PR.
   
   With this fix synapse users can start the server as follows which will 
enable debug mood for log-mediator. 
   
   ```
   sh synapse.sh -synapseDebug
   ```
   
   Following is a sample output of the log mediator. 
   
   ```
   2020-03-04 21:01:02,663 [-] [PassThroughMessageProcessor-1]  INFO 
LogMediator To: /services/test, MessageID: 
urn:uuid:13cc5420-1282-456b-a0c0-fcfa6457c28e, Direction: request, someproperty 
= somevalue
   ```
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@synapse.apache.org
For additional commands, e-mail: dev-h...@synapse.apache.org

Reply via email to