Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-32498] Fix logger #3

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -18,6 +18,7 @@
import hudson.tasks.Publisher;
import hudson.util.FormValidation;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import jenkins.model.Jenkins;
import org.eclipse.jgit.transport.RemoteConfig;
Expand Down Expand Up @@ -79,8 +80,9 @@ public boolean prebuild(AbstractBuild<?, ?> build, BuildListener listener) {
this.notifyBuildStatus(buildStatusResource, buildStatus);
listener.getLogger().println("Sending build status " + buildStatus.getState() + " to BitBucket is done!");
} catch (Exception e) {
logger.info("Bitbucket notify on start failed: " + e.getMessage());
logger.log(Level.INFO, "Bitbucket notify on start failed: " + e.getMessage(), e);
listener.getLogger().println("Bitbucket notify on start failed: " + e.getMessage());
e.printStackTrace(listener.getLogger());
}

logger.info("Bitbucket notify on start succeeded");
Expand All @@ -102,8 +104,9 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
this.notifyBuildStatus(buildStatusResource, buildStatus);
listener.getLogger().println("Sending build status " + buildStatus.getState() + " to BitBucket is done!");
} catch (Exception e) {
logger.info("Bitbucket notify on finish failed: " + e.getMessage());
logger.log(Level.INFO, "Bitbucket notify on finish failed: " + e.getMessage(), e);
listener.getLogger().println("Bitbucket notify on finish failed: " + e.getMessage());
e.printStackTrace(listener.getLogger());
}

logger.info("Bitbucket notify on finish succeeded");
Expand Down