Hi,
I'd like to use log4j with basex-api but cannot figure out how to make this work. Currently, everything goes to the console.
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
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/ba... [2] https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/ba...
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 BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
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 christian.gruen@gmail.comwrote:
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/ba... [2]
https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/ba...
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 BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
basex-talk@mailman.uni-konstanz.de