You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by do...@apache.org on 2001/11/20 12:09:46 UTC
cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/logger SimpleLogKitManager.java
donaldp 01/11/20 03:09:45
Modified: src/java/org/apache/avalon/phoenix/components/logger
SimpleLogKitManager.java
Log:
Fixed bug in which the application name was prefixed to name of categories created. This resulted in category names like
avalon-demo.simpleserver
when it should have been
simpleserver
Also added some extra debug log information.
Reported By: Antal Attila <at...@nolimits.ro>
Revision Changes Path
1.6 +9 -8 jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/logger/SimpleLogKitManager.java
Index: SimpleLogKitManager.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/logger/SimpleLogKitManager.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SimpleLogKitManager.java 2001/11/19 12:21:30 1.5
+++ SimpleLogKitManager.java 2001/11/20 11:09:45 1.6
@@ -44,9 +44,6 @@
private final static String DEFAULT_FORMAT =
"%{time} [%7.7{priority}] (%{category}): %{message}\\n%{throwable}";
- //Base name of logger categories
- private String m_name;
-
///Base directory of applications working directory
private File m_baseDirectory;
@@ -56,7 +53,6 @@
public void contextualize( final Context context )
throws ContextException
{
- m_name = (String)context.get( "app.name" );
m_baseDirectory = (File)context.get( "app.home" );
}
@@ -132,12 +128,10 @@
private void configureCategories( final Configuration[] categories, final HashMap targets )
throws ConfigurationException
{
- final String prefix = m_name + ".";
-
for( int i = 0; i < categories.length; i++ )
{
final Configuration category = categories[ i ];
- final String name = prefix + category.getAttribute( "name", "" );
+ final String name = category.getAttribute( "name", "" );
final String target = category.getAttribute( "target" );
final String priorityName = category.getAttribute( "priority" );
@@ -156,8 +150,15 @@
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( prefix ) )
+ if( name.equals( "" ) )
{
m_logHierarchy.setDefaultPriority( priority );
m_logHierarchy.setDefaultLogTarget( logTarget );
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>