Package org.apache.log

Examples of org.apache.log.Priority


        } else if (prio.equalsIgnoreCase("ERR")) //$NON-NLS-1
        {
            printDetails(System.err, s, t, c);
        } else {
            // N.B. if the string is not recognised, DEBUG is assumed
            Priority p = Priority.getPriorityForName(prio);
            if (log.isPriorityEnabled(p)) {// Thread method is potentially expensive
                String tn = Thread.currentThread().getName();
                StringBuilder sb = new StringBuilder(40);
                sb.append(tn);
                if (c.length()>0){
View Full Code Here


        } else if (prio.equalsIgnoreCase("ERR")) //$NON-NLS-1
        {
            printDetails(System.err, s, t, c);
        } else {
            // N.B. if the string is not recognised, DEBUG is assumed
            Priority p = Priority.getPriorityForName(prio);
            if (log.isPriorityEnabled(p)) {// Thread method is potentially expensive
                String tn = Thread.currentThread().getName();
                StringBuffer sb = new StringBuffer(40);
                sb.append(tn);
                if (c.length()>0){
View Full Code Here

    private void initTarget(final String file, final RuntimeServices rsvc) throws Exception
    {
        try
        {
            String format = null;
            Priority level = null;
            if (rsvc != null)
            {
                format = rsvc.getString(AVALON_LOGGER_FORMAT, "%{time} %{message}\\n%{throwable}");
                level = (Priority) logLevels.get(rsvc.getString(AVALON_LOGGER_LEVEL, "debug"));
            }
View Full Code Here

                    brokenLinkFile = new File(option.getArgument());
                    break;
            }
        }

        final Priority priority = Priority.getPriorityForName(logLevel);
        Hierarchy.getDefaultHierarchy().setDefaultPriority(priority);
        log = Hierarchy.getDefaultHierarchy().getLoggerFor("");

        if (destDir.equals("")) {
            String error = "Careful, you must specify a destination dir when using the -d/--destDir argument";
View Full Code Here

            logLevel = "INFO";
        }

        final String accesslogger = getInitParameter("servlet-logger");

        final Priority logPriority = Priority.getPriorityForName(logLevel.trim());

        final ServletOutputLogTarget servTarget = new ServletOutputLogTarget(this.servletContext);

        final CocoonLogFormatter formatter = new CocoonLogFormatter();
        formatter.setFormat( "%7.7{priority} %{time}   [%8.8{category}] " +
View Full Code Here

            logLevel = "INFO";
        }

        final String accesslogger = getInitParameter("servlet-logger");

        final Priority logPriority = Priority.getPriorityForName(logLevel.trim());

        final ServletOutputLogTarget servTarget = new ServletOutputLogTarget(this.servletContext);

        final CocoonLogFormatter formatter = new CocoonLogFormatter();
        formatter.setFormat( "%7.7{priority} %{time}   [%8.8{category}] " +
View Full Code Here

    private void initTarget(final String file, final RuntimeServices rsvc) throws Exception
    {
        try
        {
            String format = null;
            Priority level = null;
            if (rsvc != null)
            {
                format = rsvc.getString(AVALON_LOGGER_FORMAT, "%{time} %{message}\\n%{throwable}");
                level = (Priority) logLevels.get(rsvc.getString(AVALON_LOGGER_LEVEL, "warn"));
            }
View Full Code Here

    protected void initLogger() {
        final String logLevel = getInitParameter("log-level", "INFO");

        final String accesslogger = getInitParameter("servlet-logger", "cocoon");

        final Priority logPriority = Priority.getPriorityForName(logLevel);

        final CocoonLogFormatter formatter = new CocoonLogFormatter();
        formatter.setFormat("%7.7{priority} %{time}   [%8.8{category}] " +
                            "(%{uri}) %{thread}/%{class:short}: %{message}\\n%{throwable}");
        final ServletOutputLogTarget servTarget = new ServletOutputLogTarget(this.servletContext, formatter);
View Full Code Here

    {
        // Setup the log manager.  Get the logger name and log level from attributes
        //  in the <logkit> node
        String lmLoggerName = confLM.getAttribute( "logger", "lm" );
        String lmLogLevel = confLM.getAttribute( "log-level", "INFO" );
        Priority lmPriority = Priority.getPriorityForName( lmLogLevel );
        DefaultLogKitManager logKitManager = new DefaultLogKitManager();
        Logger lmLogger = Hierarchy.getDefaultHierarchy().getLoggerFor( lmLoggerName );
        lmLogger.setPriority( lmPriority );
        logKitManager.enableLogging( new LogKitLogger( lmLogger ) );
        logKitManager.contextualize( context );
View Full Code Here

    // Create a new hierarchy. This is needed when CocoonBean is called from
    // within a CocoonServlet call, in order not to mix logs
    final Hierarchy hierarchy = new Hierarchy();

    final Priority priority = Priority.getPriorityForName(this.logLevel);
    hierarchy.setDefaultPriority(priority);

    // Install a temporary logger so that getDir() can log if needed
    this.log = new LogKitLogger(hierarchy.getLoggerFor(""));
View Full Code Here

TOP

Related Classes of org.apache.log.Priority

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.