/** Switch logging off */ public final static void disableDeltaLogging() { LogCtl.disable(LoggerNameBase); }
/** * Turn on a logger (all levels). Works for Log4j and Java logging as the * logging provider to Apache common logging or slf4j. */ static public void disable(String logger) { setLevel(logger, "OFF") ; }
/** * Turn on a logger (all levels). Works for Log4j and Java logging as the * logging provider to Apache common logging or slf4j. */ static public void enable(Logger logger) { enable(logger.getName()) ; }
/** * Set logging, suitable for a command line application. * <ol> * <li>Check for -Dlog4j.configuration.</li> * <li>Looks for log4j.properties file in current directory.</li> * <li>Sets log4j using the provided default configuration.</li> * </ol> * T */ public static void setCmdLogging(String defaultConfig) { if ( !setLog4j() ) resetLogging(log4Jsetup) ; }
/** Reset java.util.logging - this overrided the previous configuration, if any. */ public static void resetJavaLogging() { Path p = Paths.get(JUL_LOGGING) ; if ( Files.exists(p) ) { setJavaLogging(JUL_LOGGING) ; return ; } if ( setJavaLoggingClasspath(JUL_LOGGING) ) return ; setJavaLoggingDft(); }
public static void setJavaLogging() { setJavaLogging("logging.properties") ; }
/** * Set logging, suitable for a command line application. * If "log4j.configuration" not set, then use the provided default * (log4j properties syntax) else just leave to log4j startup. */ public static void setCmdLogging(String defaultConfig) { if (System.getProperty("log4j.configuration") == null ) resetLogging(defaultConfig) ; }
/** * Set logging, suitable for a command line application. * If "log4j.configuration" not set, then use the built-in default, * else just leave to log4j startup. */ public static void setCmdLogging() { setCmdLogging(log4Jsetup) ; }
/** Switch logging on from this point */ public final static void enableDeltaLogging() { LogCtl.setInfo(LoggerNameBase); }
@Test public void customAgg_12() { LogCtl.setError(AggregatorFactory.class); try { String qs = "SELECT (AGG <"+aggIRI2+">(?o) AS ?x) {?s ?p ?o } GROUP BY ?s" ; Query q = QueryFactory.create(qs, Syntax.syntaxARQ) ; String qs2 = q.serialize(Syntax.syntaxARQ) ; Query q2 = QueryFactory.create(qs2, Syntax.syntaxARQ) ; assertEquals(q, q2) ; } finally { LogCtl.setInfo(AggregatorFactory.class); } }
LogCtl.setError(SysRIOT.riotLoggerName) ; Dataset dataset = getDataset(query) ;
public static void main(String[] args) { // Stop Fuseki trying to initialize logging using log4j. System.setProperty("log4j.configuration", "delta"); LogCtl.setJavaLogging(); FusekiMainCmd.main(args); } }
/** Reset java.util.logging - this overrided the previous configuration, if any. */ public static void resetJavaLogging() { Path p = Paths.get(JUL_LOGGING) ; if ( Files.exists(p) ) { setJavaLogging(JUL_LOGGING) ; return ; } if ( setJavaLoggingClasspath(JUL_LOGGING) ) return ; setJavaLoggingDft(); }
/** * Set logging, suitable for a command line application. * If "log4j.configuration" not set, then use the provided default * (log4j properties syntax) else just leave to log4j startup. */ public static void setCmdLogging(String defaultConfig) { if (System.getProperty("log4j.configuration") == null ) resetLogging(defaultConfig) ; }
/** * Set logging, suitable for a command line application. * <ol> * <li>Check for -Dlog4j.configuration.</li> * <li>Looks for log4j.properties file in current directory.</li> * <li>Sets log4j using an internal configuration.</li> * </ol> */ public static void setCmdLogging() { setCmdLogging(log4Jsetup) ; }
@AfterClass public static void afterClassLoggingOn() { LogCtl.setInfo(SystemTDB.errlog.getName()) ; }
LogCtl.setError(SysRIOT.riotLoggerName) ; Dataset dataset = getDataset() ; modTime.startTimer() ;
@Override protected void execCmd() { LogCtl.disable(Delta.DELTA_HTTP_LOG.getName()); getPositional().forEach(fn->exec1(fn)); }