Hi, just in case someone need to write to JBoss console using XWiki Groovy. Don't import the JBoss logger, use apache logger instead: import org.apache.log4j.Logger; Thanks, R. Tronicek Our environment 1.8 XE with XEM plugin JBoss 1.4.1 & 1.4.2 Tronicek wrote:
Hi,
to automate group membership i wrote a Groovy script. It is called periodically via scheduler. This script use log4j to write some informations at info and at warning level to the console and to a database table.
By now we are missing the output. It vanished since XWiki XE 1.6. Can you tell me how to enable the output again, please? Thanks.
A simple extract (snippet):
/* Groovy Class: $doc.fullName ([View Code>$doc.fullName?viewer=code]) #* */ import org.jboss.logging.Logger; class UpdateGroupMembershipClass{ def xwiki; def context; def doc; def log; // Logger void setXWiki(xwiki) {
this.xwiki = xwiki; this.context = this.xwiki.getXWikiContext(); this.doc = this.context.getDoc(); this.log = Logger.getLogger("our.organization.XWiki." + this.doc.getFullName()); log.info("XWiki context initialized."); } /* other methods ... */ } /* *# */
I guess this is a logger configuration setting (it doesn't print "info" messages). You could either configure the logging system to print them, or increase the importance of the message (log.error("XWiki context initialized");) -- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users -- View this message in context: http://n2.nabble.com/Groovy-using-log4j-output-tp1575886p2562622.html Sent from the XWiki- Users mailing list archive at Nabble.com.