I did this in our own branch of basex and it works great, I used slf4j and the log4j bindings.
Joe On Thu, Apr 3, 2014 at 2:52 AM, Christian Grün <[email protected]>wrote: > Hi Max, > > I'd like to use log4j with basex-api but cannot figure out how to make >> this work. Currently, everything goes to the console. >> > > True. There are currently only two functions in the BaseX code that are > responsible for all output to stdio [1] and stderr [2]. We may need to > update them to allow the redirection of logging output to loggers such as > log4j. I'm not sure if this is possible without introducing any library > dependencies in the core project. Maybe someone wants to try this out? > > > Christian > > [1] > > https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/util/Util.java#L127 > [2] > > https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/util/Util.java#L145 > > > > > >> The basex-api POM defines a dependency on slf4j-nop which as far as I >> undertand logs to dev/null >> Do I need to change the basex-api POM file to replace it with the >> slf4j log4j adapter? >> >> And: what setting do I need to change the target output of the trace() >> function? >> >> My web app POM contains these settings: >> >> .... >> <dependency> >> <groupId>log4j</groupId> >> <artifactId>log4j</artifactId> >> <version>1.2.17</version> >> </dependency> >> <dependency> >> <groupId>org.eclipse.jetty</groupId> >> <artifactId>jetty-server</artifactId> >> <version>${jettyVersion}</version> >> </dependency> >> <dependency> >> <groupId>org.basex</groupId> >> <artifactId>basex-api</artifactId> >> <version>${BaseXVersion}</version> >> ... >> >> Regards, >> >> Max >> _______________________________________________ >> BaseX-Talk mailing list >> [email protected] >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >> > > > _______________________________________________ > BaseX-Talk mailing list > [email protected] > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > >
_______________________________________________ BaseX-Talk mailing list [email protected] https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

