Bug 240463 - Ability to log requests sent to the JIRA server
Summary: Ability to log requests sent to the JIRA server
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P4 enhancement (vote)
Target Milestone: 3.1   Edit
Assignee: Mark Kralj-Taylor CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2008-07-11 05:41 EDT by Mark Kralj-Taylor CLA
Modified: 2008-09-21 12:39 EDT (History)
2 users (show)

See Also:


Attachments
Patch to WebUtil to not overwrite JCL System properties set with -D on Java command line. (2.45 KB, patch)
2008-08-13 04:59 EDT, Mark Kralj-Taylor CLA
no flags Details | Diff
Patch to WebUtil to not overwrite JCL System properties set with -D on Java command line. (2.45 KB, patch)
2008-08-13 04:59 EDT, Mark Kralj-Taylor CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Kralj-Taylor CLA 2008-07-11 05:41:29 EDT
[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()).
Comment 1 Steffen Pingel CLA 2008-07-11 16:04:17 EDT
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.
Comment 2 Mark Kralj-Taylor CLA 2008-08-13 04:59:46 EDT
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
Comment 3 Mark Kralj-Taylor CLA 2008-08-13 04:59:46 EDT
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
Comment 4 Mark Kralj-Taylor CLA 2008-08-13 05:05:33 EDT
Sorry timeout lead to duplicate submit of comment and patch.
Comment 5 Steffen Pingel CLA 2008-08-13 17:01:22 EDT
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?
Comment 6 Robert Elves CLA 2008-09-21 12:39:40 EDT
Patch applied, ip log updated.