Enable mail debugging mode in Jira Server
Purpose
To detail clearly how to enable debug mode for both the incoming and outgoing emails in JIRA.
Solution
- Go to
Administration (Gear next to profile) > System > Logging and Profiling
page- This can also be accessed by pressing 'g+g' and typing
Logging and Profiling
in the pop-up.
- This can also be accessed by pressing 'g+g' and typing
- For Outgoing Mail,
- Scroll down the page to the Outgoing Mail Section
- Ensure that you have an Outgoing Mail configured and that Outgoing Mail log is enabled as without it, debugging cannot be enabled.
- Click the blue
Enable
link that appears in this section to enable outgoing mail debugging. - To persist the debug logging enabled, even after you restart Jira:
- Edit the
<jira-installation>/atlassian-jira/WEB-INF/classes/
log4j.properties
file. Locate the section:
log4j.logger.com.atlassian.mail = INFO, outgoingmaillog
and change
INFO
toDEBUG
.
- Edit the
- For batch notifications specifically, set the
package
com.atlassian.jira.plugins.inform.batching
to DEBUG
- For Incoming Mail,
- Scroll down the page to the Incoming Mail Section
- Ensure that you have an Incoming Mail configured and that Incoming Mail log is enabled as without it, debugging cannot be enabled.
- Click the blue
Enable
link that appears in this section to enable Incoming mail debugging. - To persist the debug logging enabled, even after you restart Jira:
- Edit the
<jira-installation>/atlassian-jira/WEB-INF/classes/
log4j.properties
file. Locate the section:
log4j.logger.com.atlassian.mail.incoming = INFO, incomingmaillog
and change
INFO
toDEBUG
.
- Edit the
To enable email logging for incoming and outgoing at the protocol level (more verbose), add
-Dmail.debug=true
to the Jira startup parameters.
For more information on the subject, please refer to Logging and Profiling.
Keep in mind that the primary goal of debug logging is troubleshooting. A good practice to avoid potential performance impact and logs with too many entries in the future is to disable the debug logging after the problem is solved.