]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.server/src/org/simantics/district/maps/server/TileserverMapnik.java
Unzip installed maps server at install time
[simantics/district.git] / org.simantics.maps.server / src / org / simantics / district / maps / server / TileserverMapnik.java
index 5b1e735c2ee0f60345cd0e6bcde0c1b709b35b49..b047626a53253c82561992c71f2a39855460f889 100644 (file)
@@ -22,7 +22,7 @@ import org.slf4j.LoggerFactory;
 import org.yaml.snakeyaml.Yaml;
 import org.zeroturnaround.exec.ProcessExecutor;
 import org.zeroturnaround.exec.StartedProcess;
-import org.zeroturnaround.exec.stream.slf4j.Slf4jStream;
+import org.zeroturnaround.exec.stream.slf4j.Slf4jDebugOutputStream;
 import org.zeroturnaround.process.PidProcess;
 import org.zeroturnaround.process.PidUtil;
 import org.zeroturnaround.process.Processes;
@@ -76,7 +76,15 @@ public class TileserverMapnik {
         
         StartedProcess startedProcess = new ProcessExecutor().directory(serverRoot.resolve("tileserver-mapnik").toFile()).destroyOnExit().environment(getEnv())
                 .command(NodeJS.executable().toString(), getTessera().toString(), "-c", getConfigJson().toString(), "-p", Integer.toString(MapsServerPreferences.defaultPort()))
-                .redirectOutput(Slf4jStream.ofCaller().asDebug()).start();
+                .redirectOutput(new Slf4jDebugOutputStream(LOGGER) {
+                    
+                    @Override
+                    protected void processLine(String line) {
+                        // Convert to UTF-8 string
+                        String utf8Line = new String(line.getBytes(), StandardCharsets.UTF_8);
+                        log.debug(utf8Line);
+                    }
+                }).start();
         
         Process nativeProcess = startedProcess.getProcess();
         process = Processes.newStandardProcess(nativeProcess);