Reputation: 20242
I'm trying to update a Jenkins plugin to add it some more functionality.
After I updated it, in a class QualityGatesProvider
there is an Exception and the Jenkins job fails.
Just before that line, I tried logging in two ways:
import java.util.logging.Logger;
//other code
private static final Logger log = Logger.getLogger( QualityGatesProvider.class.getName() );
log.info("QualityGatesProvider hello world");
and:
System.out.println("QualityGatesProvider hello world");
I know for sure that control reaches these statements(because in the line after them there is an exception).
However, their output doesn't appear in the log files.
Any idea what could be the problem?
Upvotes: 0
Views: 1665
Reputation: 58
Simple Example of Logging to Jenkins Console Output
When I am developing public and private plugins I just use the LOGGER commonly used in Java projects. (See example)
It does appear in the Console Output however, which is ok for debugging a build step. Not great for developing plugins that enhance functionality like adding Administrative Monitors.
Note: System.out.println()
does work for me when I use hpi:run
while developing, it prints out to my Eclipse console.
Upvotes: 0