Refine search
@BeforeSuite public void setProps() { BasicConfigurator.configure(); Logger.getRootLogger().setLevel(Level.INFO); Logger.getLogger(SimpleEVCacheTest.class).setLevel(Level.DEBUG); Logger.getLogger(Base.class).setLevel(Level.DEBUG); Logger.getLogger(EVCacheImpl.class).setLevel(Level.ERROR); Logger.getLogger(EVCacheClient.class).setLevel(Level.DEBUG); Logger.getLogger(EVCacheClientPool.class).setLevel(Level.DEBUG); System.setProperty("EVCACHE.use.simple.node.list.provider", "true"); System.setProperty("EVCACHE.EVCacheClientPool.readTimeout", "1000"); System.setProperty("EVCACHE.operation.timeout", "100000"); System.setProperty("EVCACHE.EVCacheClientPool.bulkReadTimeout", "10000"); int maxThreads = 2; final BlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>(100000); pool = new ThreadPoolExecutor(maxThreads * 4, maxThreads * 4, 30, TimeUnit.SECONDS, queue); pool.prestartAllCoreThreads(); }
@BeforeClass public void setUp() { BasicConfigurator.configure(); org.apache.log4j.Logger.getRootLogger().setLevel(Level.ERROR); }
public static void main(String[] args) throws Exception { LogManager.getRootLogger().setLevel(Level.INFO); BasicConfigurator.configure(); try { parseCmdLine(args); } catch (org.apache.commons.cli.UnrecognizedOptionException e) { SDFSLogger.getBasicLog().warn(e.toString()); printHelp(buildOptions()); } catch (Exception e) { SDFSLogger.getBasicLog().error("An error occured", e); System.exit(-1); } } }
public MaryModuleTestCase(boolean needMaryStarted) throws Exception { if (!MaryUtils.isLog4jConfigured()) { BasicConfigurator.configure(); } Logger.getRootLogger().setLevel(Level.DEBUG); if (System.getProperty("mary.base") == null) { System.setProperty("mary.base", "."); Logger.getRootLogger().warn( "System property 'mary.base' is not defined -- trying " + new File(".").getAbsolutePath() + " -- if this fails, please start this using VM property \"-Dmary.base=/path/to/mary/runtime\"!"); } if (needMaryStarted) { if (Mary.currentState() == Mary.STATE_OFF) Mary.startup(); } }
public static void main(String[] args) { BasicConfigurator.configure(); StdoutRedirectToLog.redirect(); Logger log = Logger.getLogger(TestStdout.class); String message = "222222222222222222222222222\n222222222222222222222222222222222"; log.info(message); System.out.println("11111111111111111111111111\n1111111111111111111111111111111"); System.out.println("11111111111111111111111111\n1111111111111111111111111111111"); System.out.println("11111111111111111111111111\n1111111111111111111111111111111"); System.out.println("11111111111111111111111111\n1111111111111111111111111111111"); printException(10); }
public static void main(String[] args) { // The invocation of the BasicConfigurator.configure method // creates a rather simple log4j setup. This method is hardwired // to add to the root logger a ConsoleAppender. BasicConfigurator.configure(); // time series 1 2 3 4 5 6 7 double[] testData = {10, 18, 20, 30, 24, 33, 27}; int[] allWindowSizes = {3, 4}; for (int windowSize : allWindowSizes) { SimpleMovingAverage sma = new SimpleMovingAverage(windowSize); THE_LOGGER.info("windowSize = " + windowSize); for (double x : testData) { sma.addNewNumber(x); THE_LOGGER.info("Next number = " + x + ", SMA = " + sma.getMovingAverage()); } THE_LOGGER.info("---"); } } }
/** Ensures that Log4J is configured, by invoking, if necessary, * {@link org.apache.log4j.BasicConfigurator#configure()}, and * setting the root logger level to <code>level</code>. * * @param klass the calling class (to be shown to the user). * @param level the required logging level. */ public static void ensureLog4JIsConfigured( final Class<?> klass, final Level level ) { if ( ! log4JIsConfigured() ) { System.err.println( "WARNING: " + ( klass != null ? klass.getSimpleName() + " is" : "We are" ) + " autoconfiguring Log4J (level: " + level + "). You should configure Log4J properly instead." ); BasicConfigurator.configure(); LogManager.getRootLogger().setLevel( level ); } }
@Bean public AstrixFrameworkBean astrixFrameworkBean() { BasicConfigurator.configure(); org.apache.log4j.Logger.getLogger("com.avanza.astrix").setLevel(org.apache.log4j.Level.DEBUG); AstrixFrameworkBean result = new AstrixFrameworkBean(); result.setSubsystem("lunch-web"); result.setConsumedAstrixBeans(LunchService.class, LunchRestaurantGrader.class, LunchUtil.class); return result; }
public static void main(String[] args) throws IOException, InterruptedException, Exception { org.apache.log4j.BasicConfigurator.configure();
public BetterCommandLine() { BasicConfigurator.configure(); LogManager.getRootLogger().setLevel(Level.OFF); Appender appender = (Appender)LogManager.getRootLogger().getAllAppenders().nextElement(); appender.setLayout(new PatternLayout("%d{HH:mm:ss,SSS} [%t] %-5p %c{2} - %m%n")); }
protected static void initLogFile(int level) throws IOException { FileAppender appender = new FileAppender(new PatternLayout(LOGGING_PATTERN), System.getProperty("ode.home") + "/logs/ode.log"); appender.setName("file appender"); initialize(appender, level); BasicConfigurator.configure(appender); Logger.getRootLogger().addAppender(appender); }
protected VoiceImportComponent() { if (!Logger.getRootLogger().getAllAppenders().hasMoreElements()) { BasicConfigurator.configure(); } logger = MaryUtils.getLogger(getName()); }
public void setUp() throws Exception { // Setup a console appender BasicConfigurator.resetConfiguration(); PatternLayout layout = new PatternLayout("%r %-5p [%c{1}] %m%n"); ConsoleAppender appender = new ConsoleAppender(layout); BasicConfigurator.configure(appender); }
@Test public void testV1() throws IOException { BasicConfigurator.configure(); Logger.getRootLogger().setLevel(Level.DEBUG); final String expected = "test"; final String ciphered = "eyJ2ZXIiOiIxLjAiLCJ2YWwiOiJOd1hRejdOMjBXUU05SXEzaE94RVZnPT0ifQ=="; final String passphrase = "test1234"; final Crypto crypto = new Crypto(); final String actual = crypto.decrypt(ciphered, passphrase); Assert.assertEquals(expected, actual); try { new CryptoV1_1().decrypt(ciphered, passphrase); Assert.fail("Should have failed when decrypt v1 ciphered text with v1.1 decryption."); } catch (final Exception e) { Assert.assertTrue(e instanceof RuntimeException); } }
public MaryModuleTestCase(boolean needMaryStarted) throws Exception { if (!MaryUtils.isLog4jConfigured()) { BasicConfigurator.configure(); } Logger.getRootLogger().setLevel(Level.DEBUG); if (System.getProperty("mary.base") == null) { System.setProperty("mary.base", "."); Logger.getRootLogger().warn( "System property 'mary.base' is not defined -- trying " + new File(".").getAbsolutePath() + " -- if this fails, please start this using VM property \"-Dmary.base=/path/to/mary/runtime\"!"); } if (needMaryStarted) { if (Mary.currentState() == Mary.STATE_OFF) Mary.startup(); } }
/** Ensures that Log4J is configured, by invoking, if necessary, * {@link org.apache.log4j.BasicConfigurator#configure()}, and * setting the root logger level to <code>level</code>. * * @param klass the calling class (to be shown to the user). * @param level the required logging level. */ public static void ensureLog4JIsConfigured( final Class<?> klass, final Level level ) { if ( ! log4JIsConfigured() ) { System.err.println( "WARNING: " + ( klass != null ? klass.getSimpleName() + " is" : "We are" ) + " autoconfiguring Log4J (level: " + level + "). You should configure Log4J properly instead." ); BasicConfigurator.configure(); LogManager.getRootLogger().setLevel( level ); } }
public static void main(String[] args) throws IOException, InterruptedException, Exception { org.apache.log4j.BasicConfigurator.configure();
public void setUp() throws Exception { // Setup a console appender BasicConfigurator.resetConfiguration(); PatternLayout layout = new PatternLayout("%r %-5p [%c{1}] %m%n"); ConsoleAppender appender = new ConsoleAppender(layout); BasicConfigurator.configure(appender); }
private static void configureFallbackLogging() { final Layout layout = new PatternLayout("%-5r [%-25.25c{1} %-10.10t %-5.5p] %m%n"); final Appender appender = new ConsoleAppender(layout); BasicConfigurator.configure(appender); Logger.getRootLogger().setLevel(Level.WARN); Logger.getLogger("ui").setLevel(Level.OFF); }
@Test public void testV1_1() throws IOException { BasicConfigurator.configure(); Logger.getRootLogger().setLevel(Level.DEBUG); final String expected = "test"; final String ciphered = "eyJ2ZXIiOiIxLjEiLCJ2YWwiOiJpaE9CM2VzTzBad2F4cHZBV2Z5YUVicHZLQzJBWDJZZnVzS3hVWFN2R3A0PSJ9"; final String passphrase = "test1234"; final Crypto crypto = new Crypto(); final String actual = crypto.decrypt(ciphered, passphrase); Assert.assertEquals(expected, actual); try { new CryptoV1().decrypt(ciphered, passphrase); Assert.fail("Should have failed when decrypt v1.1 ciphered text with v1 decryption."); } catch (final Exception e) { Assert.assertTrue(e instanceof RuntimeException); } }