Package java.util.logging

Examples of java.util.logging.LogManager


        this.setWithStackTrace(withStackTrace);
        this.columns = aColumns;
    }
   
    public SGEFormatter() {
        LogManager manager = LogManager.getLogManager();
       
        String cname = getClass().getName();
       
        String str = manager.getProperty(cname + ".withStacktrace");
        if(str != null) {
            setWithStackTrace(Boolean.valueOf(str).booleanValue());
        }
       
        str = manager.getProperty(cname + ".columns");
       
        if(str != null ) {
            StringTokenizer st = new StringTokenizer(str, " ");
           
            List columns = new ArrayList();
           
            while(st.hasMoreTokens() ) {
                Column col = getColumn(st.nextToken());
                if(col != null) {
                    columns.add(col);
                }
            }
            this.columns = new int[columns.size()];
            for(int i = 0; i < columns.size(); i++) {
                this.columns[i] = ((Column)columns.get(i)).getId();
            }
           
        } else {
            this.columns = DEFAULT_COLUMNS;
        }
       
        str = manager.getProperty(cname + ".name");
        if(str == null) {
            str = "Unknown";
        }
        this.name = name;
    }
View Full Code Here


        String name = (String) p.getKey();
        String value = ((String[]) p.getValue())[0];

        if (name.equals("submit")) continue;
        Logger logger;
        LogManager logManager = LogManager.getLogManager();
        if ("root".equals(name)) {
          logger = logManager.getLogger("");
        } else logger = logManager.getLogger(name);

        if ("unset".equals(value)) {
          if ((logger != null) && (logger.getLevel() != null)) {
            logger.setLevel(null);
            log.info("Unset log level on '" + name + "'.");
View Full Code Here

    // Use tree to get sorted results
    SortedSet<LogWrapper> roots = new TreeSet<LogWrapper>();

    roots.add(LogWrapper.ROOT);

    LogManager logManager = LogManager.getLogManager();

    Enumeration<String> loggerNames = logManager.getLoggerNames();
    while (loggerNames.hasMoreElements()) {
      String name = loggerNames.nextElement();
      Logger logger = Logger.getLogger(name);
      LogWrapper wrapper = new LogWrapper(logger);
      roots.remove(wrapper); // Make sure add occurs
View Full Code Here

     * Creates an instance of this class.
     *
     * @throws  ClassNotFoundException if the exception class is not found
     */
    public ExceptionFilter() throws ClassNotFoundException {
  LogManager logManager = LogManager.getLogManager();
  String value = logManager.getProperty(EXCEPTION_CLASS_PROPERTY);
  exceptionClass = (value != null)
      ? Class.forName(value).asSubclass(Throwable.class)
      : Throwable.class;
  value = logManager.getProperty(LEVEL_PROPERTY);
  level = (value != null) ? Level.parse(value) : Level.INFO;
    }
View Full Code Here

    /** Whether to print stack traces. */
    private final boolean printStack;

    /** Creates an instance of this class. */
    public LogFormatter() {
  LogManager logManager = LogManager.getLogManager();
  String value = logManager.getProperty(TIME_FORMAT_PROPERTY);
  timeFormat = (value != null) ? value : DEFAULT_TIME_FORMAT;
  value = logManager.getProperty(PRINT_STACK_PROPERTY);
  printStack = (value == null) || Boolean.parseBoolean(value);
    }
View Full Code Here

            setRowCount(0);

            origLevels = new TreeMap<String, Level>();

            // collect the logger names and levels, and sort them by their name
            LogManager logManager = LogManager.getLogManager();
            Enumeration<String> loggerNames = logManager.getLoggerNames();
            while (loggerNames.hasMoreElements()) {
                String loggerName = loggerNames.nextElement();
                if (loggerName.length() == 0) {
                    // skip loggers with empty names
                    continue;
View Full Code Here

*/
public class LogControl {
   
    /** Creates a new instance of LogControl */
    public LogControl(Class refClass, String loggingProperties) {
        LogManager logManager = LogManager.getLogManager();
        InputStream in = refClass.getResourceAsStream(loggingProperties);
//        System.out.println("************************ LOADING LOG config from "+in);
        try {
            logManager.readConfiguration(in);
        } catch(IOException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

  {
    DisplayMode chosenMode = null;
    int targetWidth = 800;
    int targetHeight = 600;

    LogManager logManager = LogManager.getLogManager();
    logManager.readConfiguration();
    logger = Logger.getLogger("");
   
    try
    {
      DisplayMode[] modes = Display.getAvailableDisplayModes();
View Full Code Here

    {
      // Configure java.util.logging and get a Logger instance
      System
          .setProperty("java.util.logging.config.file",
              PROPERTIES_FILE);
      LogManager logManager = LogManager.getLogManager();
      logManager.readConfiguration();
      logger = Logger.getLogger("");

      // Read the properties configuration
      reader = new FileReader(PROPERTIES_FILE);
      properties = new Properties();
View Full Code Here

    {
      // Configure java.util.logging and get a Logger instance
      System
          .setProperty("java.util.logging.config.file",
              PROPERTIES_FILE);
      LogManager logManager = LogManager.getLogManager();
      logManager.readConfiguration();
      logger = Logger.getLogger("");

      // Read the properties configuration
      reader = new FileReader(PROPERTIES_FILE);
      Client.properties = new Properties();
View Full Code Here

TOP

Related Classes of java.util.logging.LogManager

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.