Package org.apache.log4j

Examples of org.apache.log4j.SimpleLayout


        if (logFile != null)
            logFile.delete();
        Logger logger = Logger.getLogger(clazz);
        logger.removeAllAppenders();
        logger.setLevel(Level.DEBUG);
        SimpleLayout layout = new SimpleLayout();
        File newLogFile = File.createTempFile("log", "");
        FileAppender appender = new FileAppender(layout, newLogFile.toString(),
                        false, false, 0);
        logger.addAppender(appender);
        return newLogFile;
View Full Code Here


            @Override
            public boolean requiresLayout() {
                return false;
            }
        };
        appender.setLayout(new SimpleLayout());
        Logger logger = Logger.getLogger("org.apache.curator");
        logger.addAppender(appender);

        // Check that we can intercept error log messages from the client
        CuratorFramework clientTestLogSetup = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
View Full Code Here

                                configurationProperties.getProperty(
                                "gov.nist.javax.sip.DEBUG_LOG_OVERWRITE"));

                        FileAppender fa = null;
                        try {
                            fa = new FileAppender(new SimpleLayout(),
                                    this.logFileName, !overwrite);
                        } catch (FileNotFoundException fnf) {

                            // Likely due to some directoy not existing. Create
                            // them
                            File logfile = new File(this.logFileName);
                            logfile.getParentFile().mkdirs();
                            logfile.delete();

                            try {
                                fa = new FileAppender(new SimpleLayout(),
                                        this.logFileName);
                            } catch (IOException ioe) {
                                ioe.printStackTrace(); // give up
                            }
                        } catch (IOException ex) {
View Full Code Here

    @Override
    public void setUp() throws Exception{
        Logger logger = Logger.getLogger(Rule.class);
        logger.removeAllAppenders();
        logger.setLevel(Level.INFO);
        SimpleLayout layout = new SimpleLayout();
        logFile = File.createTempFile("log", "");
        FileAppender appender = new FileAppender(layout, logFile.toString(), false, false, 0);
        logger.addAppender(appender);
       
        Logger pigStorageWithTraceLogger = Logger.getLogger(PigStorageWithTrace.class);
View Full Code Here

    private static final Log logger = LogFactory.getLog(TikaCLI.class);

    public static void main(String[] args) throws Exception {
        BasicConfigurator.configure(
                new WriterAppender(new SimpleLayout(), System.err));
        Logger.getRootLogger().setLevel(Level.INFO);

        TikaCLI cli = new TikaCLI();
        if (args.length > 0) {
            for (int i = 0; i < args.length; i++) {
View Full Code Here

            new PropertyConfigurator().doConfigure(logfile, _creator);
        }
        catch (IOException e)
        {
            _creator.getRootLogger()
                .addAppender(new ConsoleAppender(new SimpleLayout(),
                                                 ConsoleAppender.SYSTEM_OUT));
            _creator.getRootLogger().setLevel((Level)Level.INFO);
        }
        _loggers = new HashMap();
    }
View Full Code Here

        String helo = null;
        String defaultExplanation = null;
        boolean useBestGuess = false;
        boolean useTrustedForwarder = false;

        SimpleLayout layout = new SimpleLayout();
        ConsoleAppender consoleAppender = new ConsoleAppender(layout);
        logger.addAppender(consoleAppender);

        logger.setLevel(Level.ERROR);
View Full Code Here

    public void run() {

        try {
            _logger = Logger.getLogger(this.getName());
            _appender =
                new FileAppender(new SimpleLayout(), "C:\\threadlog\\"
                    + this.getName() + ".txt", false);
            _logger.addAppender(_appender);
            _logger.setLevel((Level) Level.ERROR);

            LdapContext tdsContext = getContext();
View Full Code Here

    @Override
    public void setUp() throws Exception{
        Logger logger = Logger.getLogger(PruneColumns.class);
        logger.removeAllAppenders();
        logger.setLevel(Level.INFO);
        SimpleLayout layout = new SimpleLayout();
        logFile = File.createTempFile("log", "");
        FileAppender appender = new FileAppender(layout, logFile.toString(), false, false, 0);
        logger.addAppender(appender);
       
        Logger pigStorageWithTraceLogger = Logger.getLogger(PigStorageWithTrace.class);
View Full Code Here

        if (logFile != null)
            logFile.delete();
        Logger logger = Logger.getLogger(clazz);
        logger.removeAllAppenders();
        logger.setLevel(Level.DEBUG);
        SimpleLayout layout = new SimpleLayout();
        logFile = File.createTempFile("log", "");
        FileAppender appender = new FileAppender(layout, logFile.toString(),
                        false, false, 0);
        logger.addAppender(appender);
    }
View Full Code Here

TOP

Related Classes of org.apache.log4j.SimpleLayout

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.