Search in sources :

Example 1 with AcsJIllegalArgumentEx

use of alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx in project ACS by ACS-Community.

the class LogLevelSelectorPanel method refreshAllLoggersPanel.

/**
	 * This method makes remote calls and should not be called in the event thread!
	 * @throws AcsJCORBAProblemEx In case of ORB / network failure or if remote process is unresponsive or unreachable.
	 */
private void refreshAllLoggersPanel() throws AcsJCORBAProblemEx {
    try {
        LogLevels defaultLevels = logConf.get_default_logLevels();
        int acsLevel = defaultLevels.minLogLevelLocal;
        try {
            LogTypeHelper logTypeLocal = LogTypeHelper.fromAcsCoreLevel(AcsLogLevelDefinition.fromInteger(acsLevel));
            allLocalCB.setSelectedIndex(logTypeLocal.ordinal());
            model.setCommonLocalLevel(logTypeLocal);
        } catch (AcsJIllegalArgumentEx e) {
            logger.warning("Unexpected log level " + acsLevel + " obtained as default minLogLevelLocal.");
        }
        acsLevel = defaultLevels.minLogLevel;
        try {
            LogTypeHelper logTypeGlobal = LogTypeHelper.fromAcsCoreLevel(AcsLogLevelDefinition.fromInteger(acsLevel));
            allGlobalCB.setSelectedIndex(logTypeGlobal.ordinal());
            model.setCommonGlobalLevel(logTypeGlobal);
        } catch (AcsJIllegalArgumentEx e) {
            logger.warning("Unexpected log level " + acsLevel + " obtained as default minLogLevel.");
        }
    } catch (SystemException ex) {
        AcsJCORBAProblemEx ex2 = new AcsJCORBAProblemEx(ex);
        ex2.setInfo("Failed to retrieve logger names or levels.");
        throw ex2;
    }
}
Also used : AcsJCORBAProblemEx(alma.ACSErrTypeCommon.wrappers.AcsJCORBAProblemEx) SystemException(org.omg.CORBA.SystemException) LogTypeHelper(com.cosylab.logging.engine.log.LogTypeHelper) AcsJIllegalArgumentEx(alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx) LogLevels(alma.Logging.LoggingConfigurablePackage.LogLevels)

Example 2 with AcsJIllegalArgumentEx

use of alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx in project ACS by ACS-Community.

the class AcsAlarmSystem method set_logLevels.

/**
	 * Sets log levels for a particular named logger. If levels.useDefault is
	 * true, then the logger will be reset to using default levels; otherwise it
	 * will use the supplied local and remote levels.
	 */
public void set_logLevels(String logger_name, LogLevels levels) throws LoggerDoesNotExistEx, IllegalLogLevelsEx {
    if (levels.useDefault) {
        logConfig.clearNamedLoggerConfig(logger_name);
    } else {
        try {
            UnnamedLogger config = AcsLogLevelDefinition.createXsdLogLevelsFromIdl(levels);
            logConfig.setNamedLoggerConfig(logger_name, config);
        } catch (AcsJIllegalArgumentEx ex) {
            //throw ex.toIllegalArgumentEx();
            IllegalLogLevelsEx ille = new IllegalLogLevelsEx(ex.getErrorDesc());
            throw ille;
        }
    }
}
Also used : IllegalLogLevelsEx(alma.Logging.IllegalLogLevelsEx) UnnamedLogger(alma.maci.loggingconfig.UnnamedLogger) AcsJIllegalArgumentEx(alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx)

Example 3 with AcsJIllegalArgumentEx

use of alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx in project ACS by ACS-Community.

the class AcsAlarmSystem method set_default_logLevels.

/**
	 * Sets the log levels of the default logging configuration. These levels
	 * are used by all loggers that have not been configured individually.
	 */
public void set_default_logLevels(LogLevels levels) throws IllegalLogLevelsEx {
    try {
        logConfig.setDefaultMinLogLevel(AcsLogLevelDefinition.fromInteger(levels.minLogLevel));
        logConfig.setDefaultMinLogLevelLocal(AcsLogLevelDefinition.fromInteger(levels.minLogLevelLocal));
    } catch (AcsJIllegalArgumentEx ex) {
        //throw ex.toIllegalArgumentEx();
        IllegalLogLevelsEx ille = new IllegalLogLevelsEx(ex.getErrorDesc());
        throw ille;
    }
}
Also used : IllegalLogLevelsEx(alma.Logging.IllegalLogLevelsEx) AcsJIllegalArgumentEx(alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx)

Example 4 with AcsJIllegalArgumentEx

use of alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx in project ACS by ACS-Community.

the class AcsContainer method set_default_logLevels.

/**
	 * Sets the log levels of the default logging configuration. These levels
	 * are used by all loggers that have not been configured individually.
	 */
public void set_default_logLevels(LogLevels levels) throws IllegalLogLevelsEx {
    tryToWaitForContainerStart();
    try {
        logConfig.setDefaultMinLogLevel(AcsLogLevelDefinition.fromInteger(levels.minLogLevel));
        logConfig.setDefaultMinLogLevelLocal(AcsLogLevelDefinition.fromInteger(levels.minLogLevelLocal));
    } catch (AcsJIllegalArgumentEx ex) {
        //throw ex.toIllegalArgumentEx();
        IllegalLogLevelsEx ille = new IllegalLogLevelsEx(ex.getErrorDesc());
        throw ille;
    }
}
Also used : IllegalLogLevelsEx(alma.Logging.IllegalLogLevelsEx) AcsJIllegalArgumentEx(alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx)

Example 5 with AcsJIllegalArgumentEx

use of alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx in project ACS by ACS-Community.

the class AcsContainer method set_logLevels.

/**
	 * Sets log levels for a particular named logger. If levels.useDefault is
	 * true, then the logger will be reset to using default levels; otherwise it
	 * will use the supplied local and remote levels.
	 */
public void set_logLevels(String logger_name, LogLevels levels) throws LoggerDoesNotExistEx, IllegalLogLevelsEx {
    tryToWaitForContainerStart();
    if (levels.useDefault) {
        logConfig.clearNamedLoggerConfig(logger_name);
    } else {
        try {
            UnnamedLogger config = AcsLogLevelDefinition.createXsdLogLevelsFromIdl(levels);
            logConfig.setNamedLoggerConfig(logger_name, config);
        } catch (AcsJIllegalArgumentEx ex) {
            //throw ex.toIllegalArgumentEx();
            IllegalLogLevelsEx ille = new IllegalLogLevelsEx(ex.getErrorDesc());
            throw ille;
        }
    }
}
Also used : IllegalLogLevelsEx(alma.Logging.IllegalLogLevelsEx) UnnamedLogger(alma.maci.loggingconfig.UnnamedLogger) LockableUnnamedLogger(alma.acs.logging.config.LogConfig.LockableUnnamedLogger) AcsJIllegalArgumentEx(alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx)

Aggregations

AcsJIllegalArgumentEx (alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx)21 IllegalLogLevelsEx (alma.Logging.IllegalLogLevelsEx)12 UnnamedLogger (alma.maci.loggingconfig.UnnamedLogger)6 AcsJContainerServicesEx (alma.JavaContainerError.wrappers.AcsJContainerServicesEx)3 AcsJException (alma.acs.exceptions.AcsJException)2 LogConfig (alma.acs.logging.config.LogConfig)2 ReconnectionCallback (NotifyExt.ReconnectionCallback)1 ReconnectionRegistry (NotifyExt.ReconnectionRegistry)1 AcsJCORBAProblemEx (alma.ACSErrTypeCommon.wrappers.AcsJCORBAProblemEx)1 AcsJGenericErrorEx (alma.ACSErrTypeCommon.wrappers.AcsJGenericErrorEx)1 AcsJIllegalStateEventEx (alma.ACSErrTypeCommon.wrappers.AcsJIllegalStateEventEx)1 AcsJStateMachineActionEx (alma.ACSErrTypeCommon.wrappers.AcsJStateMachineActionEx)1 LogLevels (alma.Logging.LoggingConfigurablePackage.LogLevels)1 ComponentLifecycleException (alma.acs.component.ComponentLifecycleException)1 AcsLogLevel (alma.acs.logging.AcsLogLevel)1 LockableUnnamedLogger (alma.acs.logging.config.LogConfig.LockableUnnamedLogger)1 AcsLogLevelDefinition (alma.acs.logging.level.AcsLogLevelDefinition)1 OSPushConsumerPOATie (alma.acsnc.OSPushConsumerPOATie)1 LogTypeHelper (com.cosylab.logging.engine.log.LogTypeHelper)1 Date (java.util.Date)1