The purpose of this article is to guide you through the process of gathering wire logging information from the Jira Connector.
This can be useful to:
1- Get the OAuth Dance trace to troubleshoot Authroziation/Authentication issues while using OAuth.
2- See the token exchange through HTTP while using Basic Auth.
3- See the data sent and received while executing Jira Connector's operations.
To trace the HTTP message exchange between the Jira Connector and the Jira server by reading the log output received in the Mule Application logs.
The Jira Connector uses the HTTP Client under the hood to issue the requests against the Jira server, and as a consequence, enabling the HTTP Wire logging will output the HTTP requests and responses. In order to enable HTTP Wire logging in Mule Runtime 4.X releases you need to set the package "org.mule.service.http.impl.service.HttpMessageLogger" with a DEBUG level. You can find below the steps required depending on your deployment target.
A- On-premises:
Open your Mule Application project in Anypoint Studio and add the following AsyncLogger to the file log4j2.xml file located in src/main/resources:
<AsyncLogger name="org.mule.service.http.impl.service.HttpMessageLogger" level="DEBUG"/>
B- CloudHub:
In the application in question, go to the "Settings" page, select the "Logging" tab and add the entry:
DEBUG org.mule.service.http.impl.service.HttpMessageLogger
C- Runtime Fabric:
Follow the steps detailed in the Runtime Fabric public documentation "Viewing and Configuring Logs in Runtime Fabric". Replace the <PACKAGE> section with "org.mule.service.http.impl.service.HttpMessageLogger"
The entry should look like this:
logging.level.org.mule.service.http.impl.service.HttpMessageLogger
After performing the changes mentioned in your application/environment, you will be able to trace both the authentication steps and operations executed against Jira.
Example (Basic Auth exchange):
A- HTTP Request issued by the connector to authenticate using Basic Auth:
DEBUG 2022-06-09 17:37:31,394 [[test_jira].rest.connect.Jira_Connector_Config.01 SelectorRunner] [processor: ; event: ] org.mule.service.http.impl.service.HttpMessageLogger.rest.connect.Jira_Connector_Config: REQUESTER GET /rest/api/3/myself HTTP/1.1 Host: yourHost.atlassian.net User-Agent: AHC/1.0 Connection: close Accept: */* Authorization: Basic <token>
B- HTTP Response from the Jira server:
DEBUG 2022-06-09 17:37:32,519 [[test_jira].rest.connect.Jira_Connector_Config.01 SelectorRunner] [processor: ; event: ] org.mule.service.http.impl.service.HttpMessageLogger.rest.connect.Jira_Connector_Config: REQUESTER
HTTP/1.1 200 OK
Date: Thu, 09 Jun 2022 20:37:32 GMT
Content-Type: application/json;charset=UTF-8
Server: ----
Timing-Allow-Origin: *
X-Arequestid: someId
Set-Cookie: atlassian.xsrf.token=token; path=/; SameSite=None; Secure
X-Aaccountid: someAccountId
Cache-Control: no-cache, no-store, no-transform
Vary: Accept-Encoding
X-Envoy-Upstream-Service-Time: 255
Expect-Ct: report-uri="httpURL", max-age=86400
Strict-Transport-Security: max-age=63072000; preload
X-Content-Type-Options: nosniff
X-Xss-Protection: 1; mode=block
Atl-Traceid: traceID
Report-To: {"group": "endpoint", "max_age": 600, "endpoints": [{"url": "endpointURL"}], "include_subdomains": true}
Nel: {"report_to": "endpoint", "max_age": 600, "include_subdomains": true, "failure_fraction": 0.001}
Connection: close
Transfer-Encoding: chunked
445
{"self":"userAccountIDURL","accountId":"accountID","emailAddress":"email","avatarUrls":{"48x48":urls},"displayName":"displayName","active":true,"timeZone":"timezone","locale":"yourLocale","groups":{"size":1,"items":[]},"applicationRoles":{"size":1,"items":[]},"expand":"groups,applicationRoles"}
0001115162

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.