Using JIRA logging with the JIRA adapter

You can use the logging feature in JIRA to monitor and debug the JIRA adapter. Logging can be configured to specify profiles for logging and logging levels for individual features and functions in JIRA.

About this task

By default, logging options for the JIRA adapter are disabled. To enable them, follow these steps:

Procedure

  1. Create the oslc_log4j.properties file in your JIRA deployment. This file must be at jira-deployment/conf/
  2. Add the following lines to the oslc_log4j.properties file to enable logging:
    ######################################################
    # LOG FILE LOCATIONS
    #####################################################
    
    log4j.appender.licenseappender=org.apache.log4j.rolling.RollingFileAppender
    log4j.appender.licenseappender.File=${catalina.home}/logs/jira.license.csv
    log4j.appender.licenseappender.RollingPolicy=org.apache.log4j.rolling.TimeBasedRollingPolicy
    log4j.appender.licenseappender.RollingPolicy.FileNamePattern=${catalina.home}/logs/jira.license-%d{yyyy-MM-dd}.csv
    log4j.appender.licenseappender.layout=com.ibm.oslc.cm.adaptor.jira.license.DefaultLayout
    
    log4j.appender.console=org.apache.log4j.ConsoleAppender
    #log4j.appender.console.Threshold=DEBUG
    log4j.appender.console.layout=org.apache.log4j.PatternLayout
    log4j.appender.console.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
    
    log4j.appender.filelog=org.apache.log4j.RollingFileAppender
    log4j.appender.filelog.File=${catalina.home}/logs/oslc.log
    log4j.appender.filelog.layout=org.apache.log4j.PatternLayout
    log4j.appender.filelog.layout.ConversionPattern=%d{DATE} %5p %c{1}:%L - %m%n
    
    #####################################################
    # CLASS-SPECIFIC LOGGING LEVELS
    #####################################################
    # This stuff you may wish to debug, but it produces a high volume of logs.
    # Uncomment only if you want to debug something particular
    
    log4j.logger.com.ibm.oslc.cm.adaptor.jira.license = INFO, licenseappender
    log4j.additivity.com.ibm.oslc.cm.adaptor.jira.license =  false
    
    log4j.logger.com.ibm.oslc.cm.adaptor.jira = INFO, console, filelog
    log4j.additivity.com.ibm.oslc.cm.adaptor.jira =  false
    
    log4j.logger.com.ibm.oslc.cm.adaptor.jira.services = INFO, console, filelog
    log4j.additivity.com.ibm.oslc.cm.adaptor.jira.services =  false
  3. Optional: Set the logging level to DEBUG instead of INFO.
    Warning: Setting the logging level to DEBUG causes a large amount of data to be included in the oslc.log file that is found in the jira-home/logs folder.
  4. Stop and restart the JIRA server.

Results

After the JIRA server restarts, log files for the JIRA adapter are created in the jira-home/logs folder with the default names oslc.log and jira.license-{date}.csv.

What to do next

Review the available log files to monitor your system and identify any issues. You can view log information from the Support section of the JIRA Administration page. Go to JIRA Administration > Systems > Troubleshooting > Support.

Feedback