Package com.dotcms.repackage.org.apache.log4j

Examples of com.dotcms.repackage.org.apache.log4j.Logger


public class DotJasperTask extends JspC {

  @Override
  protected void processFile(String arg0) throws JasperException {
    //Init log4j to see the messages in ant's output
    Logger logRoot = Logger.getRootLogger();
    if (!logRoot.getAllAppenders().hasMoreElements()) {
      logRoot.addAppender(new ConsoleAppender(   new PatternLayout("%m%n")));
    }
    if ( ((!arg0.endsWith("_inc.jsp")) && (!arg0.startsWith("/html/plugins/"))) || includeJSP(arg0)) {
      super.processFile(arg0);
    } else {
      //System.err.println("Skipping: " + arg0);
View Full Code Here


        String loggerName = name.substring(10, name.length());

        String priority = ParamUtil.getString(
          req, name, Level.INFO.toString());

        Logger logger = Logger.getLogger(loggerName);

        logger.setLevel(Level.toLevel(priority));
      }
    }
  }
View Full Code Here

        Set currentLoggerNames = new HashSet();

        Enumeration enu = LogManager.getCurrentLoggers();

        while (enu.hasMoreElements()) {
          Logger logger = (Logger)enu.nextElement();

          currentLoggerNames.add(logger.getName());
        }

        try {
          SAXReader reader = new SAXReader();

          Document doc = reader.read(portalLog4jUrl);

          Element root = doc.getRootElement();

          Iterator itr = root.elements("category").iterator();

          while (itr.hasNext()) {
            Element category = (Element)itr.next();

            String name = category.attributeValue("name");
            String priority =
              category.element(
                "priority").attributeValue("value");

            Logger logger = Logger.getLogger(name);

            logger.setLevel(Level.toLevel(priority));
          }
        }
        catch (Exception e) {
          com.dotmarketing.util.Logger.error(this,e.getMessage(),e);
        }
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.apache.log4j.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.