Package org.apache.log

Examples of org.apache.log.Logger


            super(name);
        }

        public void testAdd1() throws Exception
        {
      Logger log =
        LoggingManager.getLoggerForClass();
            Collection treePath =
                Arrays.asList(new String[] { "1", "2", "3", "4" });
            HashTree tree = new HashTree();
            log.debug("treePath = " + treePath);
            tree.add(treePath, "value");
            log.debug("Now treePath = " + treePath);
            log.debug(tree.toString());
            assertEquals(1, tree.list(treePath).size());
            assertEquals("value", tree.getArray(treePath)[0]);
        }
View Full Code Here


        if (true)
        {
            return;
        }

        final Logger logger = parser.getLogger();
        try {
            // Create an instance of the Jalopy bean
            Class clazz = ObjectUtil.classForName("de.hunsicker.jalopy.Jalopy");
            Object prettifier = clazz.newInstance();

            // Set the input file
            Method input = clazz.getMethod("setInput", new Class[]{File.class});
            input.invoke(prettifier, new Object[]{file});

            // Set the output file
            Method output = clazz.getMethod("setOutput", new Class[]{File.class});
            output.invoke(prettifier, new Object[]{file});

            Class clazz2 = ObjectUtil.classForName("de.hunsicker.jalopy.storage.Convention");
            Method instance = clazz2.getMethod("getInstance", new Class[]{});
            Object settings = instance.invoke(null, new Object[]{});

            Class clazz3 = ObjectUtil.classForName("de.hunsicker.jalopy.storage.ConventionKeys");
            Field field = clazz3.getField("COMMENT_JAVADOC_PARSE");
            Object key = field.get(null);

            Method put = clazz2.getMethod("put", new Class[]{ key.getClass(), String.class});
            put.invoke(settings, new Object[]{key, "true"});

            // format and overwrite the given input file
            Method format = clazz.getMethod("format", new Class[]{});
            format.invoke(prettifier, new Object[]{});
            logger.info("prettyprinted " + file);
        } catch (ClassNotFoundException e) {
            logger.debug("unable to prettyprint: " + file, e);
        } catch (Exception e) {
            logger.debug("unable to prettyprint: " + file, e);
        } catch (Throwable t) {
            logger.debug("unable to prettyprint: " + file, t);
        }
    }
View Full Code Here

    protected void populateBindings(Bindings bindings) {
        final String label = getName();
        final String fileName = getFilename();
        final String scriptParameters = getParameters();
        // Use actual class name for log
        final Logger logger = LoggingManager.getLoggerForShortName(getClass().getName());
        bindings.put("log", logger);
        bindings.put("Label", label);
        bindings.put("FileName", fileName);
        bindings.put("Parameters", scriptParameters);
        String [] args=JOrphanUtils.split(scriptParameters, " ");//$NON-NLS-1$
View Full Code Here

    protected void initManager(BSFManager mgr) throws BSFException{
        final String label = getName();
        final String fileName = getFilename();
        final String scriptParameters = getParameters();
        // Use actual class name for log
        final Logger logger = LoggingManager.getLoggerForShortName(getClass().getName());
        mgr.declareBean("log", logger, Logger.class); // $NON-NLS-1$
        mgr.declareBean("Label",label, String.class); // $NON-NLS-1$
        mgr.declareBean("FileName",fileName, String.class); // $NON-NLS-1$
        mgr.declareBean("Parameters", scriptParameters, String.class); // $NON-NLS-1$
        String [] args=JOrphanUtils.split(scriptParameters, " ");//$NON-NLS-1$
View Full Code Here

     *
     * @param target the LogTarget
     * @param category the category name
     */
    public static void setTarget(LogTarget target, String category) {
        Logger logger = Hierarchy.getDefaultHierarchy().getLoggerFor(category);
        logger.setLogTargets(new LogTarget[] { target });
    }
View Full Code Here

        Configuration rolesConfig      = builder.build( "../conf/roles.xml" );
        Configuration componentsConfig = builder.build( "../conf/components.xml" );

        // Setup the LogKitManager
        DefaultLogKitManager logManager = new DefaultLogKitManager();
        Logger lmLogger = Hierarchy.getDefaultHierarchy().
            getLoggerFor( logKitConfig.getAttribute( "logger", "lm" ) );
        lmLogger.setPriority(
            Priority.getPriorityForName( logKitConfig.getAttribute( "log-level", "INFO" ) ) );
        logManager.setLogger( lmLogger );
        logManager.contextualize( context );
        logManager.configure( logKitConfig );
View Full Code Here

    protected void initManager(BSFManager mgr) throws BSFException{
        final String label = getName();
        final String fileName = getFilename();
        final String scriptParameters = getParameters();
        // Use actual class name for log
        final Logger logger = LoggingManager.getLoggerForShortName(getClass().getName());
        mgr.declareBean("log", logger, Logger.class); // $NON-NLS-1$
        mgr.declareBean("Label",label, String.class); // $NON-NLS-1$
        mgr.declareBean("FileName",fileName, String.class); // $NON-NLS-1$
        mgr.declareBean("Parameters", scriptParameters, String.class); // $NON-NLS-1$
        String [] args=JOrphanUtils.split(scriptParameters, " ");//$NON-NLS-1$
View Full Code Here

  public static void setPriority(Priority p) {
    Hierarchy.getDefaultHierarchy().setDefaultPriority(p);
  }

  public static void setTarget(LogTarget target, String category) {
    Logger logger = Hierarchy.getDefaultHierarchy().getLoggerFor(category);
    logger.setLogTargets(new LogTarget[] { target });
  }
View Full Code Here

    protected void populateBindings(Bindings bindings) {
        final String label = getName();
        final String fileName = getFilename();
        final String scriptParameters = getParameters();
        // Use actual class name for log
        final Logger logger = LoggingManager.getLoggerForShortName(getClass().getName());
        bindings.put("log", logger);
        bindings.put("Label", label);
        bindings.put("FileName", fileName);
        bindings.put("Parameters", scriptParameters);
        String [] args=JOrphanUtils.split(scriptParameters, " ");//$NON-NLS-1$
View Full Code Here

            if ((!isGzipSupported(req))
                    || (IConst.VALUES.FALSE.equals(Configurator.getInstance()
                            .get(IConst.CONFIG.GZIP_COMPRESS)))
                    || (req.getParameter(GZIP_NOT_ALLOWED) != null)) {
                try {
                    Logger log = JGossipLog.getInstance().getAppLogger();
                    if (log.isDebugEnabled()) {
                        log.debug("Invoke resource normally.");
                    }
                } catch (SystemException e1) { /* Ignore this exception. */
                }
                chain.doFilter(req, res);
            } else {
View Full Code Here

TOP

Related Classes of org.apache.log.Logger

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.