final Configuration category = categories[ i ];
final String name = category.getAttribute( "name", "" );
final String target = category.getAttribute( "target" );
final String priorityName = category.getAttribute( "priority" );
final Logger logger =
m_logkitLogger.getChildLogger( name );
final LogTarget logTarget = (LogTarget)targets.get( target );
if( null == target )
{
final String message = REZ.getString( "unknown-target", target, name );
throw new ConfigurationException( message );
}
final Priority priority = Priority.getPriorityForName( priorityName );
if( !priority.getName().equals( priorityName ) )
{
final String message = REZ.getString( "unknown-priority", priorityName, name );
throw new ConfigurationException( message );
}
if( getLogger().isDebugEnabled() )
{
final String message =
REZ.getString( "category-create", name, target, priorityName );
getLogger().debug( message );
}
if( name.equals( "" ) )
{
m_hierarchy.setDefaultPriority( priority );
m_hierarchy.setDefaultLogTarget( logTarget );
}
else
{
logger.setPriority( priority );
logger.setLogTargets( new LogTarget[]{logTarget} );
}
}
}