How can I shut down the Stanford CoreNLP messages (see end of post)?
I first tried setting log4j.category.edu.stanford=OFF
in log4j.properties but that didn't help so I found out that apparently it uses a nonstandard logging framework called "Redwood". According to http://nlp.stanford.edu/nlp/javadoc/javanlp/
there is a documentation but it is password protected. I tried RedwoodConfiguration.empty().apply();
but that doesn't help either.
The logging messages:
Adding annotator tokenize
Adding annotator ssplit
Adding annotator pos
Loading default properties from tagger edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger
Reading POS tagger model from edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger ... done [1,2 sec].
P.S.: Redwood.hideAllChannels();
also doesn't work. The following however suppresses my own logging statement (but not the ones from StanfordCoreNLP):
RedwoodConfiguration.empty().apply();
Redwood.log("test redwood");
Solution Ok, StevenC was right, it weren't logging statements after all but the default initialization messages are written to stderr which I was not expecting seeing that Stanford has it's own logging framework and then doesn't use it :-)
Anyways, his hints led me to discover this solution:
// shut off the annoying intialization messages
RedwoodConfiguration.empty().captureStderr().apply();
nlp = new StanfordCoreNLP(myproperties);
// enable stderr again
RedwoodConfiguration.current().clear().apply();