The server prints to stdout and stderr although we have slf4j/logback at hand.
I fixed this by:
adding a private static final Logger LOG = LoggerFactory.getLogger(ServerTools.class);
replacing org.languagetool.server.ServerTools::print with appropriate calls to the Logger
adding date and log-level to the log-pattern
I also had to delete languagetool-server/src/main/resources/logback.xml, otherwise my provided logback config -Dlogback.configurationFile=logback.xml would not be used.
I'll file a PR if you're interested.
In the long run we should probably also consider using the log levels properly. I modified the ServerTool's print() to use info/error depending on wether PrintStream is System.err or not but we can do better.
The server prints to stdout and stderr although we have slf4j/logback at hand.
I fixed this by:
private static final Logger LOG = LoggerFactory.getLogger(ServerTools.class);
org.languagetool.server.ServerTools::print
with appropriate calls to theLogger
I also had to delete
languagetool-server/src/main/resources/logback.xml
, otherwise my provided logback config-Dlogback.configurationFile=logback.xml
would not be used.I'll file a PR if you're interested.
In the long run we should probably also consider using the log levels properly. I modified the ServerTool's
print()
to use info/error depending on wetherPrintStream
isSystem.err
or not but we can do better./edit: This seems related.