@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof LoggingInfo)) { return false; } LoggingInfo other = (LoggingInfo) obj; if (level == null) { if (other.getLevel() != null) return false; } else if (!level.equals(other.getLevel())) return false; if (location == null) { if (other.getLocation() != null) return false; } else if (!location.equals(other.getLocation())) return false; if (stdOutLogging != other.isStdOutLogging()) return false; return true; } }
location= getGeoServerApplication().getGeoServer().getLogging().getLocation();
@Test public void testLogging() throws Exception { LoggingInfo logging = factory.createLogging(); logging.setLevel("CRAZY_LOGGING"); logging.setLocation("some/place/geoserver.log"); logging.setStdOutLogging(true); ByteArrayOutputStream out = out(); persister.save(logging, out); LoggingInfo logging2 = persister.load(in(out), LoggingInfo.class); assertEquals(logging, logging2); Document dom = dom(in(out)); assertEquals("logging", dom.getDocumentElement().getNodeName()); }
@Test public void testModifyLogging() { LoggingInfo logging = geoServer.getLogging(); logging.setLevel("VERBOSE_LOGGING.properties"); geoServer.save(logging); assertEquals(logging, geoServer.getLogging()); } }
location = getGeoServerApplication().getGeoServer().getLogging().getLocation();
logging.setLevel((String) global.get("log4jConfigFile")); logging.setLocation((String) global.get("logLocation")); logging.setStdOutLogging(!get(global, "suppressStdOutLogging", Boolean.class)); } else { logging.setStdOutLogging(true);
String loggingLevel = logging.getLevel(); String loggingLocation = logging.getLocation(); Boolean stdOutLogging = logging.isStdOutLogging();
assertEquals(null, geoServer.getLogging().getLocation());
final String location = LoggingUtils.getLogFileLocation( loginfo.getLocation(), event.getServletContext()); LoggingUtils.initLogging( loader, loginfo.getLevel(), !loginfo.isStdOutLogging(), location); } else {
@Test public void testGlobal() throws Exception { GeoServerInfo info = importer.getConfiguration().getGlobal(); assertNotNull(info); LoggingInfo logging = importer.getConfiguration().getLogging(); assertNotNull(logging); assertEquals("DEFAULT_LOGGING.properties", logging.getLevel()); assertTrue(logging.isStdOutLogging()); assertEquals("logs/geoserver.log", logging.getLocation()); assertFalse(info.isVerbose()); assertFalse(info.isVerboseExceptions()); assertEquals(8, info.getNumDecimals()); assertEquals("UTF-8", info.getCharset()); assertEquals(3, info.getUpdateSequence()); } }