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

New commits:
commit eb81d18ef19b6ca4c84ecb63983665c46fa95b8d
Author:     Andras Timar <[email protected]>
AuthorDate: Sun Jun 14 17:33:37 2020 +0200
Commit:     Jan Holesovsky <[email protected]>
CommitDate: Fri Jun 19 12:10:16 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/+/96277
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Jan Holesovsky <[email protected]>

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 d15e25902..5c77a8a12 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)
     {
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to