Package org.geoserver.config

Examples of org.geoserver.config.LoggingInfo


            }

        }

        // LOGGING
        LoggingInfo loggingInfo = geoserver.getLogging();
        if (loggingInfo == null) {
            LOGGER.warning("Missing logging info. Creating default.");
            loggingInfo = this.geoserver.getFactory().createLogging();
            geoserver.setLogging(loggingInfo);
        }
View Full Code Here


        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

                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);
                        LoggingUtils.initLogging(loader, loginfo.getLevel(), !loginfo.isStdOutLogging(),
                            loginfo.getLocation());
                    }
                    finally {
                        in.close();
                    }
                }
View Full Code Here

        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

                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);
                        final String location = getLogFileLocation(loginfo.getLocation());
                        LoggingUtils.initLogging(loader, loginfo.getLevel(), !loginfo.isStdOutLogging(),
                            location);
                    }
                    finally {
                        in.close();
                    }
View Full Code Here

   
    @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

        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

        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

            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

        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

TOP

Related Classes of org.geoserver.config.LoggingInfo

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.