diff options
Diffstat (limited to 'netx/net/sourceforge')
-rw-r--r-- | netx/net/sourceforge/jnlp/util/logging/OutputController.java | 9 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/util/logging/UnixSystemLog.java | 21 |
2 files changed, 22 insertions, 8 deletions
diff --git a/netx/net/sourceforge/jnlp/util/logging/OutputController.java b/netx/net/sourceforge/jnlp/util/logging/OutputController.java index 3bec9f0..554a05d 100644 --- a/netx/net/sourceforge/jnlp/util/logging/OutputController.java +++ b/netx/net/sourceforge/jnlp/util/logging/OutputController.java @@ -174,8 +174,13 @@ public class OutputController { if (LogConfig.getLogConfig().isLogToFile()) { getFileLog().log(message); } - if (LogConfig.getLogConfig().isLogToSysLog()) { - getSystemLog().log(message); + //only crucial stuff is going to system log + //only java messages handled here, plugin is onhis own + if (LogConfig.getLogConfig().isLogToSysLog() && + (s.getHeader().level.equals(Level.ERROR_ALL) || s.getHeader().level.equals(Level.WARNING_ALL)) && + s.getHeader().isC == false) { + //no headers here + getSystemLog().log(s.getMessage()); } } diff --git a/netx/net/sourceforge/jnlp/util/logging/UnixSystemLog.java b/netx/net/sourceforge/jnlp/util/logging/UnixSystemLog.java index 157d91f..2571178 100644 --- a/netx/net/sourceforge/jnlp/util/logging/UnixSystemLog.java +++ b/netx/net/sourceforge/jnlp/util/logging/UnixSystemLog.java @@ -44,14 +44,23 @@ public class UnixSystemLog implements SingleStreamLogger{ } - + @Override - public void log(String s) { - + public void log(String message) { + final String s = "IcedTea-Web java error - for more info see itweb-settings debug options or console. See http://icedtea.classpath.org/wiki/IcedTea-Web#Filing_bugs for help.\nIcedTea-Web java error manual log: \n" + message; + try { + String[] ss = s.split("\\n"); //exceptions have many lines + for (String m : ss) { + m = m.replaceAll("\t", " "); + ProcessBuilder pb = new ProcessBuilder("logger", "-p","user.err", "--", m); + Process p = pb.start(); + p.waitFor(); + OutputController.getLogger().log("System logger called with result of " + p.exitValue()); + } + } catch (Exception ex) { + OutputController.getLogger().log(ex); + } } - - - } |