Package java.util.logging

Examples of java.util.logging.FileHandler$MeasureOutputStream


    public void testEmptyPattern_4params() throws SecurityException,
            IOException {
        // regression HARMONY-2421
        try {
            new FileHandler(new String(), 1, 1, true);
            fail("Expected an IllegalArgumentException");
        } catch (IllegalArgumentException e) {
            // Expected
        }
    }
View Full Code Here


          try {
              logFile.getParentFile().mkdirs();
          } catch (final Exception e) {
            LogUtil.logSevere(e);
          }
          fileHandler = new FileHandler(logFile.getCanonicalPath(), true);
          fileHandler.setLevel(Level.ALL);
          fileHandler.setFormatter(StaticLogFile.LogFileFormatter.newInstance());
          logger.addHandler(fileHandler);
      } catch (final Exception e) {
        LogUtil.logSevere(e);
View Full Code Here

           
            final ConsoleHandler console = new TerminalConsoleHandler();
            global.addHandler(console);
           
            final File logFile = file;
            final FileHandler fileHandler = new FileHandler(
                    logFile.getAbsolutePath(), 500000, 5, true);
            fileHandler.setFormatter(new LogFormatter(true));
            global.addHandler(fileHandler);
           
            System.setOut(new PrintStream(System.out) {
               
               
View Full Code Here

        String counts = props.getProperty(domain+PROP_LOGFILE_COUNT_SUFFIX);
        if (counts != null) {
            count = Integer.parseInt(counts);
        }

        FileHandler h = new FileHandler(logfile, limit, count, true);
        h.setFormatter(new LogSimpleFormatter(_logger));
        _logger.addHandler(h);

        _logger.log(Level.INFO, _jbr.getString(_jbr.I_LOG_DOMAIN, _name, domain));
        _logger.log(Level.INFO, _jbr.getString(_jbr.I_LOG_FILE, _name, logfile)+"["+limit+","+count+"]");
View Full Code Here

        dir =  new File(txlogDir);
        if (!dir.exists())  dir.mkdirs();


        String logfile = dir+File.separator+"jms%g.log";
        FileHandler h =  new FileHandler(logfile, true);
        h.setFormatter(new LogSimpleFormatter(logger));
        logger.addHandler(h);

        logger.log(Level.INFO, "Exported JMSBridgeStore txlogDir is "+txlogDir);
        logger.log(Level.INFO, "Exported JMSBridgeStore uses log domain: "+logdomain);
        logger.log(Level.INFO, "Exported JMSBridgeStore uses log file: "+logfile);
View Full Code Here

        String counts = props.getProperty(domain+PROP_LOGFILE_COUNT_SUFFIX);
        if (counts != null) {
            count = Integer.parseInt(counts);
        }

        FileHandler h = new FileHandler(logfile, limit, count, true);
        h.setFormatter(new LogSimpleFormatter(_logger))
        _logger.addHandler(h);

        _logger.log(Level.INFO, getStompBridgeResources().getString(StompBridgeResources.I_LOG_DOMAIN, domain));
        _logger.log(Level.INFO, getStompBridgeResources().getString(StompBridgeResources.I_LOG_FILE, logfile)+"["+limit+","+count+"]");
View Full Code Here

        logger.setLevel( Level.ALL );

        String logfileName = ConnectionManager.getModificationLogFileName( connection );
        try
        {
            FileHandler fileHandler = new FileHandler( logfileName, getFileSizeInKb() * 1000, getFileCount(), true );
            fileHandlers.put( connection.getId(), fileHandler );
            fileHandler.setFormatter( new Formatter()
            {
                public String format( LogRecord record )
                {
                    return record.getMessage();
                }
View Full Code Here

        logger.setLevel( Level.ALL );

        String logfileName = ConnectionManager.getSearchLogFileName( connection );
        try
        {
            FileHandler fileHandler = new FileHandler( logfileName, getFileSizeInKb() * 1000, getFileCount(), true );
            fileHandlers.put( connection.getId(), fileHandler );
            fileHandler.setFormatter( new Formatter()
            {
                public String format( LogRecord record )
                {
                    return record.getMessage();
                }
View Full Code Here

            Handler handler = new ConsoleHandler();
            if (file != null && file.length() > 0)
            {
                try
                {
                    handler = new FileHandler
                    (
                        substituteImplname (file, config),
                        config.getAttributeAsBoolean (ATTR_LOG_APPEND, false)
                    );
                }
View Full Code Here

    public DebugLog(String l, String f) {
        super(l, null);

        try {
            handler = new FileHandler(f, true);
            addHandler(handler);
            setLevel(Level.ALL);
            handler.setFormatter(formatter);
        } catch (Exception e) {
            System.out.println("Error creating logger '" + l + "': ");
View Full Code Here

TOP

Related Classes of java.util.logging.FileHandler$MeasureOutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.