Skip to Content.
Sympa Menu

notify-dpml - r1268 - in trunk/main: metro/runtime/src/main/net/dpml/metro/runtime planet/http/impl/src/main/net/dpml/http station/server/etc/prefs/propertiess station/server/etc/prefs/xmls station/server/src/main/net/dpml/station/server transit/core/src/main/net/dpml/transit/util

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1268 - in trunk/main: metro/runtime/src/main/net/dpml/metro/runtime planet/http/impl/src/main/net/dpml/http station/server/etc/prefs/propertiess station/server/etc/prefs/xmls station/server/src/main/net/dpml/station/server transit/core/src/main/net/dpml/transit/util
  • Date: Fri, 24 Mar 2006 23:50:51 +0100

Author: mcconnell
Date: 2006-03-24 23:50:48 +0100 (Fri, 24 Mar 2006)
New Revision: 1268

Modified:

trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java

trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComponentModel.java
trunk/main/planet/http/impl/src/main/net/dpml/http/LoggerAdapter.java
trunk/main/planet/http/impl/src/main/net/dpml/http/Server.java
trunk/main/station/server/etc/prefs/propertiess/application.properties
trunk/main/station/server/etc/prefs/xmls/registry.xml

trunk/main/station/server/src/main/net/dpml/station/server/RemoteApplication.java

trunk/main/transit/core/src/main/net/dpml/transit/util/ConfigurationHandler.java

trunk/main/transit/core/src/main/net/dpml/transit/util/PropertyResolver.java
Log:
housekeeping related to logging

Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java
2006-03-24 20:28:44 UTC (rev 1267)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java
2006-03-24 22:50:48 UTC (rev 1268)
@@ -178,7 +178,7 @@
{
final String name = context.getName();
final String path = context.getContextPath();
- Logger logger = new StandardLogger( path.substring( 1 ).replace(
'/', '.' ) );
+ Logger logger = new StandardLogger( path.replace( '/', '.' ) );
Classpath classpath = context.getClasspath();
ClassLoader classloader = getClassLoader( anchor, classpath );
return new DefaultComponentHandler( parent, classloader, logger,
this, context, flag );

Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComponentModel.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComponentModel.java
2006-03-24 20:28:44 UTC (rev 1267)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComponentModel.java
2006-03-24 22:50:48 UTC (rev 1268)
@@ -100,7 +100,7 @@
ComponentDirective directive, String partition )
throws ControlException, IOException, RemoteException
{
- super( new StandardLogger( partition.substring( 1 ).replace( '/',
'.' ) ) );
+ super( new StandardLogger( partition.replace( '/', '.' ) ) );

m_classpath = classpath;
m_controller = controller;

Modified:
trunk/main/planet/http/impl/src/main/net/dpml/http/LoggerAdapter.java
===================================================================
--- trunk/main/planet/http/impl/src/main/net/dpml/http/LoggerAdapter.java
2006-03-24 20:28:44 UTC (rev 1267)
+++ trunk/main/planet/http/impl/src/main/net/dpml/http/LoggerAdapter.java
2006-03-24 22:50:48 UTC (rev 1268)
@@ -32,6 +32,7 @@
{
m_LOGGER = logger;
System.setProperty( "org.mortbay.log.class",
LoggerAdapter.class.getName() );
+ m_LOGGER.debug( "logging adapter established" );
}
else
{

Modified: trunk/main/planet/http/impl/src/main/net/dpml/http/Server.java
===================================================================
--- trunk/main/planet/http/impl/src/main/net/dpml/http/Server.java
2006-03-24 20:28:44 UTC (rev 1267)
+++ trunk/main/planet/http/impl/src/main/net/dpml/http/Server.java
2006-03-24 22:50:48 UTC (rev 1268)
@@ -105,12 +105,14 @@
{
super();

- LoggerAdapter.setRootLogger( logger );
-
m_logger = logger;
m_context = context;

getLogger().debug( "commencing http server deployment" );
+ Logger internal = logger.getChildLogger( "jetty" );
+ internal.debug( "assigning internal jetty logger" );
+ LoggerAdapter.setRootLogger( internal );
+
Thread.currentThread().setContextClassLoader(
getClass().getClassLoader() );
URI uri = context.getConfiguration( null );
if( null != uri )

Modified:
trunk/main/station/server/etc/prefs/propertiess/application.properties
===================================================================
--- trunk/main/station/server/etc/prefs/propertiess/application.properties
2006-03-24 20:28:44 UTC (rev 1267)
+++ trunk/main/station/server/etc/prefs/propertiess/application.properties
2006-03-24 22:50:48 UTC (rev 1268)
@@ -5,9 +5,9 @@
#

handlers=java.util.logging.FileHandler
-java.util.logging.FileHandler.pattern=${dpml.station.logging.dir}/${dpml.station.key}/log-%u.log
-java.util.logging.FileHandler.limit=50000
-java.util.logging.FileHandler.count=1
+java.util.logging.FileHandler.count=10
+java.util.logging.FileHandler.limit=100000
+java.util.logging.FileHandler.pattern=${dpml.station.logging.dir}/${dpml.station.key}/${dpml.station.key}-%g.log

java.util.logging.FileHandler.formatter=net.dpml.transit.util.StandardFormatter
sun.rmi.transport.tcp.level=INFO
sun.rmi.loader.level=INFO

Modified: trunk/main/station/server/etc/prefs/xmls/registry.xml
===================================================================
--- trunk/main/station/server/etc/prefs/xmls/registry.xml 2006-03-24
20:28:44 UTC (rev 1267)
+++ trunk/main/station/server/etc/prefs/xmls/registry.xml 2006-03-24
22:50:48 UTC (rev 1268)
@@ -9,6 +9,7 @@
<shutdown>6</shutdown>
<properties>
<property name="org.mortbay.log.class"
value="net.dpml.http.LogAdapter"/>
+ <property name="dpml.logging.level" value="FINE"/>
</properties>
</jvm>


Modified:
trunk/main/station/server/src/main/net/dpml/station/server/RemoteApplication.java
===================================================================
---
trunk/main/station/server/src/main/net/dpml/station/server/RemoteApplication.java
2006-03-24 20:28:44 UTC (rev 1267)
+++
trunk/main/station/server/src/main/net/dpml/station/server/RemoteApplication.java
2006-03-24 22:50:48 UTC (rev 1268)
@@ -333,7 +333,7 @@
Properties properties = m_descriptor.getSystemProperties();
properties.setProperty( "dpml.station.key", m_id );
properties.setProperty( "dpml.subprocess", "true" );
- properties.setProperty( "dpml.station.partition",
"depot.station.${dpml.station.key}" );
+ properties.setProperty( "dpml.station.partition", "depot.station." +
m_id );
properties.setProperty( "dpml.station.logging.dir",
"${dpml.data}/logs/station" );

//

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/util/ConfigurationHandler.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/util/ConfigurationHandler.java
2006-03-24 20:28:44 UTC (rev 1267)
+++
trunk/main/transit/core/src/main/net/dpml/transit/util/ConfigurationHandler.java
2006-03-24 22:50:48 UTC (rev 1268)
@@ -29,9 +29,7 @@
import net.dpml.transit.Transit;

/**
- * Utility class used to establish the logging configuration. The contents
of
- * this class are subject to radical change but that's largely academic
because
- * this class does not expose any operations.
+ * Utility class used to establish the logging configuration.
* @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
* @version @PROJECT-VERSION@
*/
@@ -48,40 +46,12 @@
public ConfigurationHandler()
{

- String group = System.getProperty( "dpml.logging.category", "root" );
- String level =
- System.getProperty(
- "dpml.logging.level",
- System.getProperty(
- ".level",
- "INFO" )
- ).toUpperCase();
-
- Properties properties = new Properties();
-
- setProperty( properties,
- "handlers",
- "java.util.logging.ConsoleHandler" );
- setProperty( properties,
- "java.util.logging.ConsoleHandler.formatter",
- "net.dpml.transit.util.StandardFormatter" );
-
//
- // set the default level by setting the root logger level
+ // customize the configuration based on a properties file declared
under
+ // the 'dpml.logging.config' property
//
-
- properties.setProperty( ".level", level );
-
- //
- // set the level that the console handler will handle
- //
-
- setProperty( properties, "java.util.logging.ConsoleHandler.level",
"FINEST" );

- //
- // check for any user defined logging properties
- //
-
+ Properties properties = new Properties();
String config = System.getProperty( "dpml.logging.config" );
if( null != config )
{
@@ -107,6 +77,32 @@
}
}

+ //
+ // ensure that sensible defaults exist
+ //
+
+ if( null == properties.getProperty( ".level" ) )
+ {
+ String level = getDefaultLevel();
+ properties.setProperty( ".level", level );
+ }
+
+ if( null == properties.getProperty( "handlers" ) )
+ {
+ setProperty( properties,
+ "handlers",
+ "java.util.logging.ConsoleHandler" );
+ setProperty( properties,
+ "java.util.logging.ConsoleHandler.formatter",
+ "net.dpml.transit.util.StandardFormatter" );
+ setProperty( properties,
"java.util.logging.ConsoleHandler.level", "FINEST" );
+ }
+
+ //
+ // convert the resolved properties instance to an input stream
+ // and supply this to the log manager
+ //
+
try
{
ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -126,4 +122,16 @@
{
properties.setProperty( key, System.getProperty( key, value ) );
}
+
+ private String getDefaultLevel()
+ {
+ if( "true".equals( System.getProperty( "dpml.debug" ) ) )
+ {
+ return "FINE";
+ }
+ else
+ {
+ return System.getProperty( "dpml.logging.level", "INFO"
).toUpperCase();
+ }
+ }
}

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/util/PropertyResolver.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/util/PropertyResolver.java
2006-03-24 20:28:44 UTC (rev 1267)
+++
trunk/main/transit/core/src/main/net/dpml/transit/util/PropertyResolver.java
2006-03-24 22:50:48 UTC (rev 1268)
@@ -57,7 +57,7 @@
/**
* System property symbol substitution from properties.
* Replace any occurances of ${[key]} with the value of the property
- * assigned to the [key] in the system properties.
+ * assigned to the [key] in the system properties or supplied properties.
* @param properties an arbitary properties file containing unresolved
properties
* @return the property file with expended properties
*/




  • r1268 - in trunk/main: metro/runtime/src/main/net/dpml/metro/runtime planet/http/impl/src/main/net/dpml/http station/server/etc/prefs/propertiess station/server/etc/prefs/xmls station/server/src/main/net/dpml/station/server transit/core/src/main/net/dpml/transit/util, mcconnell at BerliOS, 03/24/2006

Archive powered by MHonArc 2.6.24.

Top of Page