You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2024/04/20 10:43:36 UTC
(jena) 05/07: Check whether to log logging at initialization time
This is an automated email from the ASF dual-hosted git repository.
andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git
commit 9665c371a4e3265bf7bdf9cc4900664cd93f4ef4
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Wed Apr 17 20:29:45 2024 +0100
Check whether to log logging at initialization time
---
.../main/java/org/apache/jena/fuseki/system/FusekiLogging.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/system/FusekiLogging.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/system/FusekiLogging.java
index ba9aef67c3..629fe0f9a3 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/system/FusekiLogging.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/system/FusekiLogging.java
@@ -68,7 +68,9 @@ public class FusekiLogging
public static String logLoggingProperty = "fuseki.logLogging";
private static String logLoggingPropertyAlt = "fuseki.loglogging";
- private static final boolean LogLogging = getLogLogging();
+ // This is also set every call of seLogging.
+ // That picks up any in-code settings of the logging properties.
+ private static boolean logLogging = getLogLogging();
private static final boolean getLogLogging() {
String x = System.getProperty(logLoggingPropertyAlt);
@@ -115,12 +117,13 @@ public class FusekiLogging
* @param extraDir
*/
public static synchronized void setLogging(Path extraDir) {
+
// Cope with repeated calls so code can call this to ensure
- // logging setup has happened.
if ( loggingInitialized )
return;
loggingInitialized = true;
+ logLogging = getLogLogging();
logLogging("Set logging");
// Is there a log4j setup provided?
@@ -216,7 +219,7 @@ public class FusekiLogging
}
private static void logLogging(String fmt, Object ... args) {
- if ( LogLogging ) {
+ if ( logLogging ) {
System.err.print("Fuseki Logging: ");
System.err.printf(fmt, args);
System.err.println();