Jirong Hu
Jirong Hu

Reputation: 2375

How to configure Jenkins to report major errors to the administrator?

e.g. I have the following errors in jenkins.err.log. How can I make Jenkins email this type of errors to me?

caused by: com.microsoft.tfs.core.ws.runtime.exceptions.UnauthorizedException: Authorization failure connecting to 'http://vstsprodapp:8080/Services/v1.0/Registration.asmx' (authenticating as domain\user)

Upvotes: 0

Views: 200

Answers (1)

Christopher Orr
Christopher Orr

Reputation: 111625

This isn't a feature that's built into Jenkins.

You could use whatever system you use for monitoring your servers, and check the logs on the Jenkins server for error messages.

There is also an idea suggested on the Jenkins wiki, which allows you to use a Groovy hook script to add a further Java logging handler to Jenkins. But again, even if you do this, you would still have to implement a custom solution to send notifications based on the log's contents.

From https://wiki.jenkins-ci.org/display/JENKINS/Logging:

Put the following Groovy script into a file called $JENKINS_HOME/init.groovy.d/extra_logging.groovy:

import java.util.logging.ConsoleHandler
import java.util.logging.LogManager

def logger = LogManager.getLogManager().getLogger("hudson.WebAppMain")
logger.addHandler (new ConsoleHandler())

This will just copy all log records generated by Jenkins and any plugins to the console.

Upvotes: 1

Related Questions