In my project, I'm working with the HeidelTime framework, that I included as a Maven dependency. This framework is very verbose, so I would like to redirect its output to a file (but not all outputs from my application). The constraints are the following:
- HeidelTime uses a Logger (Log4J), so I can't simply redirect the standard output to a file.
- I can't access the logger because it's private to the main class (
HeidelTimeStandalone.java
). - I included HeidelTime in my project as a Maven dependency and I prefer to keep it as is (even if I could download the code and modify directly the source code to make the logger public...)
- Finally, I don't want to simply redirect all outputs (
java -jar myApplication.jar > file.txt
) because I would like to preserve my standard output apart from HeidelTime's output...
Does anybody have an idea to redirect HeidelTime's output in a file? Hope this at least is possible!
Turning off the heideltime's logger can be achieved like this (taken from https://github.com/HeidelTime/heideltime/issues/86)