public static void setupLogging(String application) throws UnknownHostException { System.setProperty("org.apache.accumulo.core.application", application); if (System.getenv("ACCUMULO_LOG_DIR") != null) System.setProperty("org.apache.accumulo.core.dir.log", System.getenv("ACCUMULO_LOG_DIR")); else System.setProperty("org.apache.accumulo.core.dir.log", System.getenv("ACCUMULO_HOME") + "/logs/"); String localhost = InetAddress.getLocalHost().getHostName(); System.setProperty("org.apache.accumulo.core.ip.localhost.hostname", localhost); // Use a specific log config, if it exists String logConfigFile = locateLogConfig(System.getenv("ACCUMULO_CONF_DIR"), application); // Turn off messages about not being able to reach the remote logger... we protect against that. LogLog.setQuietMode(true); // Set up local file-based logging right away Log4jConfiguration logConf = new Log4jConfiguration(logConfigFile); logConf.resetLogger(); }
final String logConfigFile = locateLogConfig(System.getenv("ACCUMULO_CONF_DIR"), application);