Thank you for reply, but I have problem with this tutorial.
package com.example.tutorial;
import javax.inject.Named;
import com.atlassian.bitbucket.event.repository.RepositoryPullEvent;
import com.atlassian.event.api.EventListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Named("testListener")
public class TestListener {
private static final Logger log = LoggerFactory.getLogger(TestListener.class);
//Whenever a push is made, the RepositoryPushEvent is fired and this listener is called
@EventListener
public void onPushEvent(RepositoryPullEvent pushEvent) {
log.debug("A push was made to {}", pushEvent.getRepository());
}
}
This code doesn’t work, because when I use command “git fetch” or “git pull”, I don’t see any new logs in terminal. Breakpoint on “log.debug([…])” doesn’t work too. I tried RepositoryPushEvent, but doesn’t work too…
To enable debug logging, go to the Bitbucket Server administration area, choose Logging and Profiling (under ‘Support’) and select Enable debug logging . Learn more
Finally, It works! Thank you @yorlov for your help!
I do two things:
Add logging.logger.{packageName}=INFO (in my case, logging.logger.com.example.prl=INFO ) line to {projectFolder}/target/bitbucket/home/shared/bitbucket.properties
Add packages to <Import-Package> in pom.xml file (in my case, above code):