Community
Participate
Working Groups
[Version: Mylyn 3 on Eclipse 3.4] Please provide a documented way to turn on logging of all requests sent to the JIRA server. Please cover at least: * JIRA SOAP/RPC requests * JIRA Web requests Why? ==== * To help understand how Mylyn operations interact with the JIRA server. ** Are they doing more than is necessary to achieve the end goal * To debug Mylyn-JIRA issues, so can provide effective feedback enabling quick resolution, or even user-patches. There are several issues around updates and retireval of JIRA custom field values. Mylyn JIRA logging would really help users and Mylyn comitters diagnose and fix these glitches that are preventing people from using Mylyn featrues (like udpate) with real JIRA installs that tend to be customised. Suggested requirements: ================ 1) Covers all JIRA interaction: SOAP/RPC/Web 2) The logging must be optional, to avoid any performance and disk space impact by default. 3) The logging should include parameter information, both parameter names and values. 4) Where does the JIRA log go? * Ideally the log would be delivers to a 'Mylyn task Repository log' or a 'Mylyn-JIRA-log' in the Eclipse 'Console' view. Similar to 'CVS' logging that is available in the Console view drop-down. * To make this feature available sooner, it would be fine if it is delivers to System.out or Eclipse platform event log (as information entries in the 'Error Log' view). 5) Ideally gives some context on what Mylyn is doing at a higher level - Refresh repository query - Create task - Update task - etc If this logging is already in Mylyn, then please document how to turn it on so it is given interleaved with JIAR logging, to give the context. Notes: ==== I did spend 10 minutes scanning Mylyn JIRA source code, but couldn't see an obvious way to turn on this kind fo logging. Please do document and advise me if its there and I missed it. I considered adding my own logging, but backed-off because most of the objects that looked worth logging didn't have toString() methods, so in my brief scan of the code I didn't find an obvious spot where I could simply add: System.out.println( a-single-object .toString()).
Web calls are performed through get or post requests by calling WebUtil.execute(). The library used is Apache HttpClient which can be configured to log all requests. The WebClientLog class has some sample code how to do this. One difficulty is that with Mylyn 3.0 HttpClient is shared with other Eclipse plug-ins so logging would pick up requests from other plug-ins as well. All SOAP calls are send using Apache Axis which I believe allows logging of requests as well: http://ws.apache.org/axis/java/developers-guide.html#Logging/Tracing. The Axis plug-in is shared as well.
Created attachment 109874 [details] Patch to WebUtil to not overwrite JCL System properties set with -D on Java command line. Currently WebUtil sets JDL system properties without checking if a value has already been set explicitly. This means you have to edit Mylyn code to change JCL logging. The patch lets you control JCL logging with -D settings on the Java command line that launched Eclipse. For example adding this to your Eclipse Java launch command line enables verbose Mylyn wire logging: -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog -Dorg.apache.commons.logging.simplelog.showlogname=true -Dorg.apache.commons.logging.simplelog.defaultlog=off -Dorg.apache.commons.logging.simplelog.log.httpclient.wire=debug -Dorg.apache.commons.logging.simplelog.log.org.apache.commons.httpclient=off -Dorg.apache.commons.logging.simplelog.log.org.apache.axis.message=debug
Created attachment 109875 [details] Patch to WebUtil to not overwrite JCL System properties set with -D on Java command line. Currently WebUtil sets JDL system properties without checking if a value has already been set explicitly. This means you have to edit Mylyn code to change JCL logging. The patch lets you control JCL logging with -D settings on the Java command line that launched Eclipse. For example adding this to your Eclipse Java launch command line enables verbose Mylyn wire logging: -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog -Dorg.apache.commons.logging.simplelog.showlogname=true -Dorg.apache.commons.logging.simplelog.defaultlog=off -Dorg.apache.commons.logging.simplelog.log.httpclient.wire=debug -Dorg.apache.commons.logging.simplelog.log.org.apache.commons.httpclient=off -Dorg.apache.commons.logging.simplelog.log.org.apache.axis.message=debug
Sorry timeout lead to duplicate submit of comment and patch.
Thanks for pointing that out Mark. Rob, we could add detection code that would leave the settings untouched in case the system property has been set?
Patch applied, ip log updated.