Hello,
I'm trying to write my first Stash plugin (implementing a PreRecieveHook). I have a bug in the plugin, and would like to add some logging (which would be nice to have anyway). However, I cannot see how to do this. I've seen several questions/answers on more complex logging requirements (separate files for plugin etc), but I just need to output to the console / main logfile. Could anyone help with this?
Community moderators have prevented the ability to post new answers.
You can use slf4j loggers like this:
import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class MyComponent { private static final Logger log = LoggerFactory.getLogger(MyComponent.class); public void myMethod() { ... log.info("Log a message here"); ... } }
By default INFO, WARN and ERROR log message should be enabled. If you want to see DEBUG and TRACE as well, you can customize the logging configuration through a custom logback.xml in your STASH_HOME directory or by adding stash-config.properties as described here: https://confluence.atlassian.com/display/STASH/Stash+debug+logging
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.