public void imprt(File dir) throws Exception { LegacyServicesReader reader = reader(dir); Map<String, Object> global = reader.global(); configFileName = (String) global.get("log4jConfigFile"); logFile = (String) global.get("logLocation"); suppressStdOutLogging = Converters.convert(global.get("suppressStdOutLogging"), Boolean.class); }
LegacyLoggingImporter loggingImporter = new LegacyLoggingImporter(); loggingImporter.imprt(baseDir); final String location = LoggingUtils.getLogFileLocation(loggingImporter.getLogFile(), null); LoggingUtils.initLogging( loader, loggingImporter.getConfigFileName(), loggingImporter.getSuppressStdOutLogging(), location); } else {
@Test public void test() throws Exception { assertEquals("DEFAULT_LOGGING.properties", importer.getConfigFileName()); assertFalse(importer.getSuppressStdOutLogging()); assertEquals("logs/geoserver.log", importer.getLogFile()); } }
@Before public void setUp() throws Exception { gs = new GeoServerImpl(); importer = new LegacyLoggingImporter(); importer.imprt(URLs.urlToFile(getClass().getResource("services.xml")).getParentFile()); }