[Libreoffice-commits] online.git: loolwsd.xml.in sysconfig.loolwsd wsd/LOOLWSD.cpp

Andras Timar (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 15 14:06:59 UTC 2020


 loolwsd.xml.in    |    5 ++++-
 sysconfig.loolwsd |    7 -------
 wsd/LOOLWSD.cpp   |    3 +++
 3 files changed, 7 insertions(+), 8 deletions(-)

New commits:
commit faf9ccbd0a0561e1a4ab2e263c5cf17990f8d198
Author:     Andras Timar <andras.timar at collabora.com>
AuthorDate: Sun Jun 14 17:33:37 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Jun 15 16:06:37 2020 +0200

    Add LOKit logging option to configuration file
    
    Environment variable in sysconfig.loolwsd was not good, because:
    1) it was a systemd antipattern
    2) this systemd environment file was not present on all distros
    3) we had to take care about this separately, when we did not start
       loolwsd from systemd
    
    Change-Id: I5c47668ca388c2f4b0afd6da8c575a3fb3cfab3b
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96291
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/loolwsd.xml.in b/loolwsd.xml.in
index 27e1d6e87..951b96079 100644
--- a/loolwsd.xml.in
+++ b/loolwsd.xml.in
@@ -49,7 +49,10 @@
     <logging>
         <color type="bool">true</color>
         <level type="string" desc="Can be 0-8, or none (turns off logging), fatal, critical, error, warning, notice, information, debug, trace" default="@LOOLWSD_LOGLEVEL@">@LOOLWSD_LOGLEVEL@</level>
-        <protocol type="bool" descr="Enable minimal client-site JS protocol logging from the start">@ENABLE_DEBUG_PROTOCOL@</protocol>
+        <protocol type="bool" desc="Enable minimal client-site JS protocol logging from the start">@ENABLE_DEBUG_PROTOCOL@</protocol>
+        <!-- lokit_sal_log example: Log WebDAV-related messages, that is interesting for debugging Insert - Image operation: "+TIMESTAMP+INFO.ucb.ucp.webdav+WARN.ucb.ucp.webdav"
+             See also: https://docs.libreoffice.org/sal/html/sal_log.html -->
+        <lokit_sal_log type="string" desc="Fine tune log messages from LOKit. Default is to suppress log messages from LOKit." default="-INFO-WARN">-INFO-WARN</lokit_sal_log>
         <file enable="@LOOLWSD_LOG_TO_FILE@">
             <property name="path" desc="Log file path.">@LOOLWSD_LOGFILE@</property>
             <property name="rotation" desc="Log file rotation strategy. See Poco FileChannel.">never</property>
diff --git a/sysconfig.loolwsd b/sysconfig.loolwsd
index 69e59adc5..a2747d27e 100644
--- a/sysconfig.loolwsd
+++ b/sysconfig.loolwsd
@@ -4,10 +4,3 @@
 ## Default:	""
 ## ServiceRestart: loolwsd
 #
-
-# warning/info logging from LOKit
-# read the documentation at https://docs.libreoffice.org/sal/html/sal_log.html
-# Example:
-# Log WebDAV-related messages, that is interesting for debugging Insert - Image operation
-# SAL_LOG="+TIMESTAMP+INFO.ucb.ucp.webdav+WARN.ucb.ucp.webdav"
-SAL_LOG="-INFO-WARN"
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 93858ad28..c77c49152 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -897,6 +897,7 @@ void LOOLWSD::initialize(Application& self)
             { "logging.file.property[7][@name]", "archive" },
             { "logging.file[@enable]", "false" },
             { "logging.level", "trace" },
+            { "logging.lokit_sal_log", "-INFO-WARN" },
             { "loleaflet_html", "loleaflet.html" },
             { "loleaflet_logging", "false" },
             { "net.listen", "any" },
@@ -994,6 +995,8 @@ void LOOLWSD::initialize(Application& self)
     // Set the log-level after complete initialization to force maximum details at startup.
     LogLevel = getConfigValue<std::string>(conf, "logging.level", "trace");
     setenv("LOOL_LOGLEVEL", LogLevel.c_str(), true);
+    std::string SalLog = getConfigValue<std::string>(conf, "logging.lokit_sal_log", "-INFO-WARN");
+    setenv("SAL_LOG", SalLog.c_str(), 0);
     const bool withColor = getConfigValue<bool>(conf, "logging.color", true) && isatty(fileno(stderr));
     if (withColor)
     {


More information about the Libreoffice-commits mailing list