I am trying to set up a logger to run with the linking plugin I created. From this website, it seems that the SLF4J Logger is the one I should use. So I set up the code as follows to test.
import org.slf4j.Logger; import org.slf4j.LoggerFactory; ... other imports public class AnnotatedListener implements DisposableBean { private static final Logger log = LoggerFactory.getLogger(AnnotatedListener.class); protected EventPublisher eventPublisher; public AnnotatedListener(EventPublisher eventPublisher, PageManager pageManager) { this.eventPublisher = eventPublisher; eventPublisher.register(this); } @EventListener public void pageCreateEvent(PageCreateEvent event) { log.info("PageCreateEvent Occured"); processEvent(event.getPage()); } }
I am not getting any sort of response to a log that I know of. Is there some set up I am missing in an XML or properties file (cause I have done none)? I am looking at the atlassian-confluence.log file in %Confluence Home%\logs and not seeing my text added.
If you have any suggestions, I would appreciate it. Thanks for the help.
Community moderators have prevented the ability to post new answers.
Hi Bart,
You need to add your class in the Logging and Profiling screen https://confluence.atlassian.com/display/DOC/Configuring+Logging
However, this will be deleted after restarting. In the above link you will find instructions on how to make it permanent
Regards
Nelson
Thanks! Worked for me though trying to edit the properties file is a real pain. I have closed confluence using the .bat file still it shows the file is being used by something else.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.