MCPcopy Index your code
hub / github.com/questdb/questdb / configure

Method configure

core/src/main/java/io/questdb/log/LogFactory.java:575–606  ·  view source on GitHub ↗
(InputStream fis, String rootDir)

Source from the content-addressed store, hash-verified

573 }
574
575 private void configure(InputStream fis, String rootDir) throws IOException {
576 Properties properties = new Properties();
577 properties.load(fis);
578
579 // QDB_LOG_LOG_DIR env variable can be used to override log directory
580 String logDir = getProperty(properties, "log.dir");
581 if (logDir == null) {
582 if (rootDir != null) {
583 logDir = Paths.get(rootDir, "log").toAbsolutePath().toString();
584 } else {
585 logDir = ".";
586 }
587 }
588 boolean usesLogDirVar = false;
589 for (String n : properties.stringPropertyNames()) {
590 String value = getProperty(properties, n);
591 if (value.contains(LOG_DIR_VAR)) {
592 usesLogDirVar = true;
593 value = value.replace(LOG_DIR_VAR, logDir);
594 properties.put(n, value);
595 }
596 }
597
598 if (usesLogDirVar) {
599 File logDirFile = new File(logDir);
600 if (!logDirFile.exists() && logDirFile.mkdirs()) {
601 System.err.printf("Created log directory: %s%n", logDir);
602 }
603 }
604
605 configureFromProperties(properties);
606 }
607
608 private void configureDefaultWriter() {
609 int level = DEFAULT_LOG_LEVEL;

Callers 1

initMethod · 0.95

Calls 10

getPropertyMethod · 0.95
loadMethod · 0.65
toStringMethod · 0.65
getMethod · 0.65
putMethod · 0.65
existsMethod · 0.65
mkdirsMethod · 0.65
containsMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected