Package java.util.logging

Examples of java.util.logging.FileHandler


      if ( (m_Logger == null) && (!m_LoggerInitFailed) ) {
  if (m_Filename != null) {
    m_Logger = Logger.getLogger(m_Filename);
    Handler fh = null;
    try{      
      fh = new FileHandler(m_Filename, m_Size, m_NumFiles);
      fh.setFormatter(new SimpleFormatter());
      m_Logger.addHandler(fh);     
      m_LoggerInitFailed = false;
    }
    catch(Exception e) {
View Full Code Here


                    tempFile.delete();
            }
        }
       
        try {
            handler = new FileHandler(dm.getTempDir() + filename);
            handler.setFormatter(new DriveReportFormatter());
            report.addHandler(handler);
        } catch (Exception e) {
            logger.error(e, e);
        }
View Full Code Here

    }
    catch(NumberFormatException nfe){
      // if its not a number
      if(loggingOut.length()!=0){
        try {
            outHandlerList.add(new FileHandler(loggingOut,0,getInt("loggings.out.number",1)));
        } catch (SecurityException e) {
          System.err.println("Security prevents logging into files");
        } catch (IOException e) {
          System.err.println("Can not log in "+loggingOut);
        } catch (IllegalArgumentException e){
View Full Code Here

    /**Setup logger*/
   
    log.setLevel(Level.ALL);//Log all events
   
    try {
      FileHandler fileHandler = new FileHandler(ConfigurationManager.LOGS_DIR+File.separator+"JMule%u.log",(int)ConfigurationManager.LOG_FILE_SIZE,ConfigurationManager.LOG_FILES_NUMBER);
     
      fileHandler.setFormatter(new SimpleFormatter());
     
      log.addHandler(fileHandler);
     
    } catch (Throwable e) {
     
View Full Code Here

        params.remove(arg);
       
        System.setProperty(IHttpExchange.SHOW_DETAILED_ERROR_KEY, "true");

       
        FileHandler fh = new FileHandler("proxy.log", 500000, 2);
        fh.setLevel(Level.FINE);
        fh.setFormatter(new LogFormatter());

       
        ConsoleHandler ch = new ConsoleHandler();
        ch.setLevel(Level.FINE);
        ch.setFormatter(new LogFormatter());
View Full Code Here

            final Logger logger = Logger.getLogger("");
            logger.setUseParentHandlers(false);

            //for (Handler h: logger.getHandlers()) logger.removeHandler(h);
            if (!dataPath.getAbsolutePath().equals(appPath.getAbsolutePath())) {
                final FileHandler handler = new FileHandler(logPattern, 1024*1024, 20, true);
                logger.addHandler(handler);
            }

            // redirect uncaught exceptions to logging
            final Log exceptionLog = new Log("UNCAUGHT-EXCEPTION");
View Full Code Here

        params.remove(arg);
       
        System.setProperty(IHttpExchange.SHOW_DETAILED_ERROR_KEY, "true");

       
        FileHandler fh = new FileHandler("proxy.log", 500000, 2);
        fh.setLevel(Level.FINE);
        fh.setFormatter(new LogFormatter());

       
        ConsoleHandler ch = new ConsoleHandler();
        ch.setLevel(Level.FINE);
        ch.setFormatter(new LogFormatter());
View Full Code Here

    next.add(Calendar.DATE, 1);
    _endDate = next.getTimeInMillis();

    try
    {
      _handler = new FileHandler(pattern, _limit, _count, _append);
      if (_init)
      {
        _handler.setEncoding(this.getEncoding());
        _handler.setErrorManager(this.getErrorManager());
        _handler.setFilter(this.getFilter());
View Full Code Here

    {
      String rollMode = _config.getString("wrapper.logfile.rollmode", "");
      boolean append = !(rollMode.contains("WRAPPER") || rollMode.contains("JVM"));
      int count = _config.getInt("wrapper.logfile.maxfiles", 1);
      int limit = getLogLimit();
      _fileHandler = fileName.contains("%d") ? new DateFileHandler(fileName, limit, count, append) : new FileHandler(fileName, limit, count,
          append);
      _fileHandler.setFormatter(getFileFormatter());
      _fileHandler.setLevel(getLogLevel(fileLogLevel));
    }
    catch (Exception e)
View Full Code Here

  static public void logger() {
    // Create Logger
    try{
    Logger logger = Logger.getLogger("");
    logger.setLevel(Level.INFO);
    txtFile = new FileHandler("Logging.txt",true);
   
    // Create txt Formatter
    formatterTxt = new SimpleFormatter();
    txtFile.setFormatter(formatterTxt);
    logger.addHandler(txtFile);
View Full Code Here

TOP

Related Classes of java.util.logging.FileHandler

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.