/** * @param msg Message to log. */ private synchronized void log(String msg) { buf.append(msg).append(U.nl()); if (echo != null) echo.info("[GridStringLogger echo] " + msg); int logLength = logLength(); if (buf.length() > logLength) { if (echo != null) echo.warning("Cleaning GridStringLogger history."); buf.delete(0, buf.length() - logLength); } assert buf.length() <= logLength; }
/** */ @Override protected void beforeTest() throws Exception { super.beforeTest(); strLog = new GridStringLogger(false, log); strLog.logLength(1024 * 1024); }
/** * @throws Exception If failed. */ @Test public void testJulMessage() throws Exception { this.strLog = new GridStringLogger(true); strLog.logLength(300000); startGrid(0); assertTrue(strLog.toString().contains("LongJVMPauseDetector was successfully started")); }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); if (srvcCfg != null) cfg.setServiceConfiguration(srvcCfg); if (useStrLog) { GridStringLogger strLog = new GridStringLogger(false, cfg.getGridLogger()); strLog.logLength(100 * 1024); cfg.setGridLogger(strLog); strLoggers.add(strLog); } return cfg; }
public void testRebalanceThreadPoolSize() { GridStringLogger gridStrLog = new GridStringLogger(); gridStrLog.logLength(1024 * 100);
strLog.logLength(1024 * 100);
strLog.logLength(1024 * 100);