Package com.sun.enterprise.config.serverbeans

Examples of com.sun.enterprise.config.serverbeans.ModuleLogLevels$Duck


       
        Level logLevel = null;
        try {
            Config cfg =
                ServerBeansFactory.getConfigBean(sc.getConfigContext());
            ModuleLogLevels allModulesLogLevels =
                cfg.getLogService().getModuleLogLevels( );
            // _REVISIT_: Right now ModuleLogLevels element in Log-Service
            // is optional. If the user doesn't specify any module log levels
            // then we will use 'INFO' as the default. For 8.1 this should
            // be a required element.
            if( allModulesLogLevels == null ) { return Level.INFO; }
            if( allModulesLogLevels.getRoot( ).equals( "OFF" ) ) {
                return Level.OFF;
            }

            // _REVISIT_: This is a bad way of searching for a loggername match
            // clean this up after Technology Preview
            ElementProperty[] elementProperties =
                cfg.getLogService().getModuleLogLevels().getElementProperty( );

            if( elementProperties != null ) {
                for( int i = 0; i < elementProperties.length; i++ ) {
                    if( elementProperties[i].getName().equals(loggerName) ) {
                        return Level.parse( elementProperties[i].getValue());
                    }
                }
            }

            String logModName = ModuleToLoggerNameMapper.getModuleName(loggerName);
            if (logModName!=null) {
                try {
                    String val = allModulesLogLevels.getAttributeValue(logModName);
                    logLevel = Level.parse(val);
                } catch (Exception noSuch) {  //no such module name,such as "core", in <module-log-levels>
                }
      }
        } catch ( Exception e ) {
View Full Code Here


       
        try {
            ServerContext sc = ApplicationServer.getServerContext();       
            if (sc!=null)  {
                Config cfg = ServerBeansFactory.getConfigBean(sc.getConfigContext());
                ModuleLogLevels allModulesLogLevels = cfg.getLogService().getModuleLogLevels( );
                ElementProperty[] elementProperties = allModulesLogLevels.getElementProperty( );
                if( elementProperties != null ) {
                    for( int i = 0; i < elementProperties.length; i++ ) {
                        String name = elementProperties[i].getName();
                        if( loggerName.startsWith(name)) {
                            return name;
View Full Code Here

            controller.setAuthRealm(authRealms[0]);

            controller.setSystemJmxConnectorName(SYSTEM_CONNECTOR_NAME);

            LogService log = new LogService();
            ModuleLogLevels logLevels = new ModuleLogLevels();
            log.setModuleLogLevels(logLevels);
            log.setFile("${com.sun.aas.instanceRoot}/logs/server.log");
            controller.setLogService(log);

            controllers.addNodeAgent(controller, OVERWRITE);
View Full Code Here

            Logger.getAnonymousLogger().log(Level.SEVERE, "Failure while upgrading log-service. Could not create logging.properties file. ", ioe);    
      }

        try {
            //Get the logLevels
            ModuleLogLevels mll = logService.getModuleLogLevels();

            Map<String, String> logLevels = mll.getAllLogLevels();
            String file=logService.getFile();
            String instanceRoot = System.getProperty("com.sun.aas.instanceRoot");
            if (file.contains(instanceRoot)){
                file = file.replace(instanceRoot ,"${com.sun.aas.instanceRoot}");
            }
View Full Code Here

            Logger.getAnonymousLogger().log(Level.SEVERE, "Failure while upgrading log-service. Could not create logging.properties file. ", ioe);    
      }

        try {
            //Get the logLevels
            ModuleLogLevels mll = logService.getModuleLogLevels();

            Map<String, String> logLevels = mll.getAllLogLevels();
            String file=logService.getFile();
            String instanceRoot = System.getProperty("com.sun.aas.instanceRoot");
            if (file.contains(instanceRoot)){
                file = file.replace(instanceRoot ,"${com.sun.aas.instanceRoot}");
            }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.serverbeans.ModuleLogLevels$Duck

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.