mil.dod.th.ose.logging/src/mil/dod/th/ose/logging/LogWriter.java
private void updateProps(final Map<String, Object> props)
    {
        //check for properties, there is always the component name and id in the properties, if there is more than
        //that then assume they are configuration properties
        if (ConfigurationUtils.configPropertiesSet(props))
        {
            //configuration
            final LogWriterConfig config = Configurable.createConfigurable(LogWriterConfig.class, props);
            setLogFileBuffer(config.fileBufferSize());
            setLogDaysAlive(config.logDaysAlive());
            setLogSizeLimit(config.logMBSizeLimit());
            setLogLevel(config.logLevel());
            setLogMaxFileCount(config.logMaxFileCount());
        }
        else
        {
            //framework property for the buffer size
            final String bufferProp = m_Context.getProperty(LOG_FILE_BUFFER_SIZE_PROPERTY);

            //if the property from the context is null then use a default
            final int defaultBufferSize = 1;
            final int bufferSize = bufferProp == null ? defaultBufferSize : Integer.parseInt(bufferProp);
            setLogFileBuffer(bufferSize);

            //framework property for the number of days to use the same log file
            final String daysAliveProp = m_Context.getProperty(LOG_DAYS_ALIVE_PROPERTY);

            //if the property from the context is null then use a default
            final int defaultDaysAlive = 14;
            final int daysAlive = daysAliveProp == null ? defaultDaysAlive : Integer.parseInt(daysAliveProp); 
            setLogDaysAlive(daysAlive);

            //framework property for the maximum size a log file can be
            final String logSizeProp = m_Context.getProperty(LOG_SIZE_PROPERTY);

            //if the property from the context is null then use a default
            final int defaultLogSize = 1;
            final int logSize = logSizeProp == null ? defaultLogSize : Integer.parseInt(logSizeProp);
            setLogSizeLimit(logSize);
            
            //framework property for the maximum amount of log files
            final String maxLogsProp = m_Context.getProperty(LOG_FILE_COUNT_PROPERTY);
            
            //if the property from the context is null then use a default
            final int defaultMaxLogs = 1000;
            final int maxLogs = maxLogsProp == null ? defaultMaxLogs : Integer.parseInt(maxLogsProp);
            setLogMaxFileCount(maxLogs);

            //framework property for log level
            final String levelProp = m_Context.getProperty(LOG_LEVEL_PROPERTY);

            //if the property from the context is null then use a default
            final LogLevel logLevel;
            try
            {
                logLevel = levelProp == null ? LogLevel.Debug : LogLevel.valueOf(levelProp);
                setLogLevel(logLevel);
            }
            catch (final IllegalArgumentException e)
            {
                //bad data
                setLogLevel(LogLevel.Debug);
                Logging.log(LogService.LOG_WARNING, "Invalid initial log level, using default [%s]", 
                        LogLevel.Debug.toString());
            }
            Logging.log(LogService.LOG_DEBUG, "Logging service is set to log level of [%s]", 
                       LogUtil.convertOsgiToNativeLevel(m_LogLevel));
        }
    }
/**
     * Sets Log writer configurations. 
     * 
     * @param props
     *    key, value pairs for setting the {@link LogWriterConfig} values  
     */
Sets Log writer configurations.

@param props
key, value pairs for setting the  LogWriterConfig values
Sets Log writer configurations . @param props key value pairs for setting the LogWriterConfig values
private void updateProps(final Map<String, Object> props)
    {
        if (ConfigurationUtils.configPropertiesSet(props))
        {
            final LogWriterConfig config = Configurable.createConfigurable(LogWriterConfig.class, props);
            setLogFileBuffer(config.fileBufferSize());
            setLogDaysAlive(config.logDaysAlive());
            setLogSizeLimit(config.logMBSizeLimit());
            setLogLevel(config.logLevel());
            setLogMaxFileCount(config.logMaxFileCount());
        }
        else
        {
            final String bufferProp = m_Context.getProperty(LOG_FILE_BUFFER_SIZE_PROPERTY);
            final int defaultBufferSize = 1;
            final int bufferSize = bufferProp == null ? defaultBufferSize : Integer.parseInt(bufferProp);
            setLogFileBuffer(bufferSize);
            final String daysAliveProp = m_Context.getProperty(LOG_DAYS_ALIVE_PROPERTY);
            final int defaultDaysAlive = 14;
            final int daysAlive = daysAliveProp == null ? defaultDaysAlive : Integer.parseInt(daysAliveProp); 
            setLogDaysAlive(daysAlive);
            final String logSizeProp = m_Context.getProperty(LOG_SIZE_PROPERTY);
            final int defaultLogSize = 1;
            final int logSize = logSizeProp == null ? defaultLogSize : Integer.parseInt(logSizeProp);
            setLogSizeLimit(logSize);
            final String maxLogsProp = m_Context.getProperty(LOG_FILE_COUNT_PROPERTY);
            final int defaultMaxLogs = 1000;
            final int maxLogs = maxLogsProp == null ? defaultMaxLogs : Integer.parseInt(maxLogsProp);
            setLogMaxFileCount(maxLogs);
            final String levelProp = m_Context.getProperty(LOG_LEVEL_PROPERTY);
            final LogLevel logLevel;
            try
            {
                logLevel = levelProp == null ? LogLevel.Debug : LogLevel.valueOf(levelProp);
                setLogLevel(logLevel);
            }
            catch (final IllegalArgumentException e)
            {
                setLogLevel(LogLevel.Debug);
                Logging.log(LogService.LOG_WARNING, "Invalid initial log level, using default [%s]", 
                        LogLevel.Debug.toString());
            }
            Logging.log(LogService.LOG_DEBUG, "Logging service is set to log level of [%s]", 
                       LogUtil.convertOsgiToNativeLevel(m_LogLevel));
        }
    }
private void updateProps ( final Map < String , Object > props ) { if ( ConfigurationUtils . configPropertiesSet ( props ) ) { final LogWriterConfig config = Configurable . createConfigurable ( LogWriterConfig . class , props ) ; setLogFileBuffer ( config . fileBufferSize ( ) ) ; setLogDaysAlive ( config . logDaysAlive ( ) ) ; setLogSizeLimit ( config . logMBSizeLimit ( ) ) ; setLogLevel ( config . logLevel ( ) ) ; setLogMaxFileCount ( config . logMaxFileCount ( ) ) ; } else { final String bufferProp = m_Context . getProperty ( LOG_FILE_BUFFER_SIZE_PROPERTY ) ; final int defaultBufferSize = 1 ; final int bufferSize = bufferProp == null ? defaultBufferSize : Integer . parseInt ( bufferProp ) ; setLogFileBuffer ( bufferSize ) ; final String daysAliveProp = m_Context . getProperty ( LOG_DAYS_ALIVE_PROPERTY ) ; final int defaultDaysAlive = 14 ; final int daysAlive = daysAliveProp == null ? defaultDaysAlive : Integer . parseInt ( daysAliveProp ) ; setLogDaysAlive ( daysAlive ) ; final String logSizeProp = m_Context . getProperty ( LOG_SIZE_PROPERTY ) ; final int defaultLogSize = 1 ; final int logSize = logSizeProp == null ? defaultLogSize : Integer . parseInt ( logSizeProp ) ; setLogSizeLimit ( logSize ) ; final String maxLogsProp = m_Context . getProperty ( LOG_FILE_COUNT_PROPERTY ) ; final int defaultMaxLogs = 1000 ; final int maxLogs = maxLogsProp == null ? defaultMaxLogs : Integer . parseInt ( maxLogsProp ) ; setLogMaxFileCount ( maxLogs ) ; final String levelProp = m_Context . getProperty ( LOG_LEVEL_PROPERTY ) ; final LogLevel logLevel ; try { logLevel = levelProp == null ? LogLevel . Debug : LogLevel . valueOf ( levelProp ) ; setLogLevel ( logLevel ) ; } catch ( final IllegalArgumentException e ) { setLogLevel ( LogLevel . Debug ) ; Logging . log ( LogService . LOG_WARNING , "Invalid initial log level, using default [%s]" , LogLevel . Debug . toString ( ) ) ; } Logging . log ( LogService . LOG_DEBUG , "Logging service is set to log level of [%s]" , LogUtil . convertOsgiToNativeLevel ( m_LogLevel ) ) ; } }
Sets Log writer configurations.
Sets Log writer configurations .
//check for properties, there is always the component name and id in the properties, if there is more than //that then assume they are configuration properties //configuration //framework property for the buffer size //if the property from the context is null then use a default //framework property for the number of days to use the same log file //if the property from the context is null then use a default //framework property for the maximum size a log file can be //if the property from the context is null then use a default //framework property for the maximum amount of log files //if the property from the context is null then use a default //framework property for log level //if the property from the context is null then use a default //bad data