Using Logging From Your FishEye Plugin

This tutorial describes how to log messages from your plugin. Logging allows you to write information to the FishEye/Crucible log file when your plugin encounters an error, which will help you diagnose problems with your plugin.

Messages may be written at a DEBUG level – these message only appear when Debug Logging is turned on on the Admin, Server Settings page. Messages written at INFO, WARNING and ERROR levels always appear in the log.

You can log anywhere in your plugin code. Just add a snippet of code like this:

...
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
...
private static final Logger LOG = LoggerFactory.getLogger("atlassian.plugin");
...
LOG.error("Something bad happened");
LOG.debug("Information useful during development");
LOG.info("Information you wish your plugin administrators to view");

The logged output will appear in target/fecru/home/var/log/fisheye-debug.log.YYYY.MM.DD.

Was this page helpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport