Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an improvement to log-mediator #24

Merged
merged 3 commits into from
Mar 11, 2020
Merged

Conversation

shafreenAnfar
Copy link
Contributor

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.

 <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

@isudana isudana self-requested a review March 5, 2020 00:03
@isudana isudana merged commit 5d5f83f into apache:master Mar 11, 2020
shafreenAnfar pushed a commit to shafreenAnfar/synapse that referenced this pull request Mar 15, 2020
shafreenAnfar pushed a commit to shafreenAnfar/synapse that referenced this pull request Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants