Wednesday, March 16, 2011

Jira JEMH configuration

Original post here

 

JEMH Installation

  1. Add the JEMH JAR
    Get the JAR specific for your version of Jira from the top of the page and copy to the Jira WEB-INF/lib folder
  2. Add the ldaputils jar (if you use ldap)
    Get the latest ldaputils jar (currently 1.0.13) from the LDAP Util library page, take the example-ldaputil.properties file from the JAR and rename it ldaputil.properties, editing it as appropriate
  3. Setup Logging (optional)
    Modify / copy-and-modify the WEB-INF/classes/log4j.properties , this will enable logging of all EMH messages to a separate file. Default is DEBUG, other values are 'INFO', 'WARN' and 'ERROR'.
    #
    # Create a separate appender
    #
    log4j.appender.EMHFileLog=org.apache.log4j.RollingFileAppender
    log4j.appender.EMHFileLog.File=atlassian-jira-emh.log
    log4j.appender.EMHFileLog.MaxFileSize=20480KB
    log4j.appender.EMHFileLog.MaxBackupIndex=5
    log4j.appender.EMHFileLog.layout=org.apache.log4j.PatternLayout
    log4j.appender.EMHFileLog.layout.ConversionPattern=%d %t %p [%c{4}] %m%n
    log4j.appender.EMHFileLog.Threshold=DEBUG
    
    #
    # add entries for the three EMH packages
    #
    log4j.logger.com.dolby.atlassian.jira.service.util.handler=DEBUG, EMHFileLog
    log4j.additivity.com.dolby.atlassian.jira.service.util.handler=false
    
    log4j.logger.com.dolby.atlassian.jira.service.util.handler.emh=DEBUG, EMHFileLog
    log4j.additivity.com.dolby.atlassian.jira.service.util.handler.emh=false
    
    log4j.logger.com.dolby.atlassian.jira.service.util.handler.emh.processor=DEBUG, EMHFileLog
    log4j.additivity.com.dolby.atlassian.jira.service.util.handler.emh.processor=false
    
    log4j.logger.com.dolby.atlassian.jira.service.util.handler.emh.service=DEBUG, EMHFileLog
    log4j.additivity.com.dolby.atlassian.jira.service.util.handler.emh.service=false
Enabling detailed logging of lower level mail operations in Jira is covered in Logging email protocol details.
What no log file?
Whether working on Windows or Linux, a lack of recently updated atlassian-jira.log and atlassian-jira-emh.log usually means file permissions are at fault....
  1. Make Jira aware of the new handler
    POP / Imap?
    This example shows how to setup with POP, Imap is equally possible, just not documented, to use Imap, reconfigure Dovecot, and instead of modifying .../pop/popservice.xml modify .../imap/imapservice.xml.
    Update WEB-INF/classes/services/com/atlassian/jira/service/services/pop/popservice.xml to include:
    
      com.dolby.atlassian.jira.service.util.handler.CreateOrCommentHandler
      Extendable Mail Handler - CreateOrComment
    
  2. Ensure a valid POP Sever is configured
    This is under Global Settings/Mail Servers. If the virtual mailbox approach is used, only one mailbox needs to be setup, in the example shared@jira.myco.net:
  3. Configure the handler
    Modifiy the two properties files. when done, they should be copied to WEB-INF/classes:
    If you use ldap, the minimum config required is to identify a valid user which is used to validate ldap connections. If not, you don't need this file.
    The EMH config file is just an extension of the properties that a mail handler is given, anything you could put in the Jira UI, you can equally add here. Look at the settings, understand what they do, make changes as appropriate for your needs.
    The contents of the configuration file changes as new features are added and refinements are made, check the 'example-emh.properties' available inside every JAR.
Some example properties are:
projectAutoAssign=true, issuetype=3, configFile=emh.properties

Emh.properties


extract example-emh.properties from jar
unzip filename.jar
rename example-emh.properties to emh.properties
copy emh.properties file are to WEB-INF/classes/

Service Properties:

Service listing after save:

  1. Restart Jira

No comments:

Post a Comment