Examples of LoggingInfo


Examples of org.geoserver.config.LoggingInfo

   
    @Test
    public void testLogging() throws Exception {
        assertNull(dao.getLogging());
       
        LoggingInfo logging = dao.getGeoServer().getFactory().createLogging();
        dao.setLogging(logging);
       
        assertEquals(logging, dao.getLogging());
       
        logging = dao.getLogging();
        logging.setLevel("someLevel");
        dao.setLogging(logging);
       
        assertEquals(logging, dao.getLogging());
       
        logging = dao.getLogging();
        logging.setLocation("someLocation");
        dao.save(logging);
       
        assertEquals(logging, dao.getLogging());
    }
View Full Code Here

Examples of org.geoserver.config.LoggingInfo

        Document dom = dom( in( out ) );
        assertEquals( "global", dom.getDocumentElement().getNodeName() );
    }
   
    public void testLogging() throws Exception {
        LoggingInfo logging = factory.createLogging();
       
        logging.setLevel( "CRAZY_LOGGING" );
        logging.setLocation( "some/place/geoserver.log" );
        logging.setStdOutLogging( true );
       
        ByteArrayOutputStream out = out();
        persister.save( logging, out );
       
        LoggingInfo logging2 = persister.load(in(out),LoggingInfo.class);
        assertEquals( logging, logging2 );
       
        Document dom = dom( in( out ) );
        assertEquals( "logging", dom.getDocumentElement().getNodeName() );
       
View Full Code Here

Examples of org.geoserver.config.LoggingInfo

        info.setJAI( jai );
        
        geoServer.setGlobal( info );
       
        //logging
        LoggingInfo logging = factory.createLogging();
       
        logging.setLevel( (String) global.get( "log4jConfigFile") );
        logging.setLocation( (String) global.get( "logLocation") );
       
        if ( global.get( "suppressStdOutLogging" ) != null ) {
            logging.setStdOutLogging( ! get( global, "suppressStdOutLogging", Boolean.class) );   
        }
        else {
            logging.setStdOutLogging(true);
        }
        geoServer.setLogging(logging);
       
        // read services
        for ( LegacyServiceLoader sl : GeoServerExtensions.extensions( LegacyServiceLoader.class ) ) {
View Full Code Here

Examples of org.geoserver.config.LoggingInfo

            try {
                File baseDir = new File(GeoServerResourceLoader.lookupGeoServerDataDirectory(context));
                GeoServerResourceLoader loader = new GeoServerResourceLoader(baseDir);
               
                File f= loader.find( "logging.xml" );
                LoggingInfo loginfo = getLogging(loader);
                if ( loginfo != null ) {
                    final String location = LoggingUtils.getLogFileLocation(loginfo.getLocation(), event.getServletContext());
                    LoggingUtils.initLogging(loader, loginfo.getLevel(), !loginfo.isStdOutLogging(),
                        location);
                }
                else {
                    //check for old style data directory
                    f = loader.find( "services.xml" );
View Full Code Here

Examples of org.geoserver.config.LoggingInfo

        File f= loader.find( "logging.xml" );
        if ( f != null ) {
            XStreamPersister xp = new XStreamPersisterFactory().createXMLPersister();
            BufferedInputStream in = new BufferedInputStream( new FileInputStream( f ) );
            try {
                LoggingInfo loginfo = xp.load(in,LoggingInfo.class);
                return loginfo;
            }
            finally {
                in.close();
            }
View Full Code Here

Examples of org.geoserver.config.LoggingInfo

    }

    @SuppressWarnings("deprecation")
    private void reinitializeLogging() {
        try {
            LoggingInfo realLogInfo = this.getLogging();
            if (realLogInfo == null) {
                return;
            }
            LoggingInfo startLogInfo = LoggingStartupContextListener.getLogging(resourceLoader);
           
            // Doing this reflectively so that if LoggingInfo gets new properties, this should still
            // work. KS
           
            ClassProperties properties = OwsUtils.getClassProperties(LoggingInfo.class);
View Full Code Here

Examples of org.geoserver.config.LoggingInfo

        db.save(global);
    }

    @Override
    public LoggingInfo getLogging() {
        LoggingInfo loggingInfo = db.getById(GLOBAL_LOGGING_ID, LoggingInfo.class);
        return loggingInfo;
    }
View Full Code Here

Examples of org.geoserver.config.LoggingInfo

        if (null == getLogging()) {
            db.add(logging);
        } else {
            db.save(ModificationProxy.create(logging, LoggingInfo.class));
        }
        LoggingInfo saved = getLogging();
        Preconditions.checkNotNull(saved);
    }
View Full Code Here

Examples of org.geoserver.config.LoggingInfo

   
    @Test
    public void testLogging() throws Exception {
        assertNull(dao.getLogging());
       
        LoggingInfo logging = dao.getGeoServer().getFactory().createLogging();
        dao.setLogging(logging);
       
        assertEquals(logging, dao.getLogging());
       
        logging = dao.getLogging();
        logging.setLevel("someLevel");
        dao.setLogging(logging);
       
        assertEquals(logging, dao.getLogging());
       
        logging = dao.getLogging();
        logging.setLocation("someLocation");
        dao.save(logging);
       
        assertEquals(logging, dao.getLogging());
    }
View Full Code Here

Examples of org.geoserver.config.LoggingInfo

        info.setJAI( jai );
        
        geoServer.setGlobal( info );
       
        //logging
        LoggingInfo logging = factory.createLogging();
       
        logging.setLevel( (String) global.get( "log4jConfigFile") );
        logging.setLocation( (String) global.get( "logLocation") );
       
        if ( global.get( "suppressStdOutLogging" ) != null ) {
            logging.setStdOutLogging( ! get( global, "suppressStdOutLogging", Boolean.class) );   
        }
        else {
            logging.setStdOutLogging(true);
        }
        geoServer.setLogging(logging);
       
        // read services
        for ( LegacyServiceLoader sl : GeoServerExtensions.extensions( LegacyServiceLoader.class ) ) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.