User Tools

Site Tools


logging

This is an old revision of the document!


ScriptRunner Logging

You can add script runner logging to any script by adding code to your script. The log will be displayed both in catalina.out log file and in the script step (although this is delayed). To add the logging, add the following to your script:

import org.apache.log4j.Logger
import org.apache.log4j.Level
  
def log = Logger.getLogger("com.acme.CreateSubtask")
log.setLevel(Level.DEBUG)
  
log.debug("foo bar"+myVariable)

Message to the end user

import com.onresolve.scriptrunner.runner.util.UserMessageUtil
 
// Successful Action Message
UserMessageUtil.success("Created two sub-tasks to be approved")
 
// Warning message (yellow)
UserMessageUtil.warning("Failed to push issue to downstream system, will try again later")
 
// Error message (red)
UserMessageUtil.error("Failed to reopen all linked issues")
logging.1515766904.txt.gz · Last modified: 2018/01/12 09:21 by pawel