notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
r1267 - in trunk/main/station: exec/src/main/net/dpml/station/exec server/etc/prefs/propertiess server/etc/prefs/xmls server/src/main/net/dpml/station/server
- From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
- To: notify-dpml AT lists.ibiblio.org
- Subject: r1267 - in trunk/main/station: exec/src/main/net/dpml/station/exec server/etc/prefs/propertiess server/etc/prefs/xmls server/src/main/net/dpml/station/server
- Date: Fri, 24 Mar 2006 21:28:48 +0100
Author: mcconnell
Date: 2006-03-24 21:28:44 +0100 (Fri, 24 Mar 2006)
New Revision: 1267
Added:
trunk/main/station/server/etc/prefs/propertiess/application.properties
trunk/main/station/server/etc/prefs/propertiess/server.properties
Modified:
trunk/main/station/exec/src/main/net/dpml/station/exec/ApplicationHandler.java
trunk/main/station/server/etc/prefs/xmls/registry.xml
trunk/main/station/server/src/main/net/dpml/station/server/RemoteApplication.java
Log:
move logging to file per application (i.e. remove aggregation)
Modified:
trunk/main/station/exec/src/main/net/dpml/station/exec/ApplicationHandler.java
===================================================================
---
trunk/main/station/exec/src/main/net/dpml/station/exec/ApplicationHandler.java
2006-03-24 20:22:48 UTC (rev 1266)
+++
trunk/main/station/exec/src/main/net/dpml/station/exec/ApplicationHandler.java
2006-03-24 20:28:44 UTC (rev 1267)
@@ -33,6 +33,8 @@
import net.dpml.station.ApplicationException;
import net.dpml.transit.Artifact;
+import net.dpml.transit.util.PropertyResolver;
+
import net.dpml.lang.PID;
import net.dpml.lang.Logger;
@@ -161,7 +163,8 @@
URI params = getParametersURI( line );
URI categories = getCategoriesURI( line );
Properties properties = getCommandLineProperties( line );
- String partition = System.getProperty( "dpml.station.partition", ""
);
+ String raw = System.getProperty( "dpml.station.partition", "" );
+ String partition = PropertyResolver.resolve( raw );
Component component =
resolveTargetComponent(
logger, partition, uri, config, params, categories, properties );
Added: trunk/main/station/server/etc/prefs/propertiess/application.properties
===================================================================
--- trunk/main/station/server/etc/prefs/propertiess/application.properties
2006-03-24 20:22:48 UTC (rev 1266)
+++ trunk/main/station/server/etc/prefs/propertiess/application.properties
2006-03-24 20:28:44 UTC (rev 1267)
@@ -0,0 +1,14 @@
+#
+# Logging configuration template for an application (jvm) established
+# by the Station server. The template assumes that a system property
+# 'dpml.station.key' and ${dpml.station.logging.dir} are declared.
+#
+
+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.formatter=net.dpml.transit.util.StandardFormatter
+sun.rmi.transport.tcp.level=INFO
+sun.rmi.loader.level=INFO
+
Added: trunk/main/station/server/etc/prefs/propertiess/server.properties
===================================================================
--- trunk/main/station/server/etc/prefs/propertiess/server.properties
2006-03-24 20:22:48 UTC (rev 1266)
+++ trunk/main/station/server/etc/prefs/propertiess/server.properties
2006-03-24 20:28:44 UTC (rev 1267)
@@ -0,0 +1,12 @@
+#
+# Logging configuration for the Station server.
+#
+
+handlers=java.util.logging.FileHandler
+java.util.logging.FileHandler.pattern=${dpml.data}/logs/station/server-%u.log
+java.util.logging.FileHandler.limit=50000
+java.util.logging.FileHandler.count=1
+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:22:48 UTC (rev 1266)
+++ trunk/main/station/server/etc/prefs/xmls/registry.xml 2006-03-24
20:28:44 UTC (rev 1267)
@@ -8,7 +8,6 @@
<startup>6</startup>
<shutdown>6</shutdown>
<properties>
- <property name="java.util.logging.config.class"
value="net.dpml.depot.DepotLoggingConfiguration"/>
<property name="org.mortbay.log.class"
value="net.dpml.http.LogAdapter"/>
</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:22:48 UTC (rev 1266)
+++
trunk/main/station/server/src/main/net/dpml/station/server/RemoteApplication.java
2006-03-24 20:28:44 UTC (rev 1267)
@@ -18,6 +18,7 @@
package net.dpml.station.server;
+import java.io.File;
import java.io.IOException;
import java.rmi.ConnectException;
import java.rmi.RemoteException;
@@ -40,6 +41,8 @@
import net.dpml.station.ApplicationListener;
import net.dpml.station.ApplicationEvent;
+import net.dpml.transit.Transit;
+
import net.dpml.lang.Logger;
import net.dpml.lang.PID;
@@ -252,6 +255,7 @@
{
synchronized( m_state )
{
+ setupLoggingDirectory();
setProcessState( ProcessState.STARTING );
try
{
@@ -327,8 +331,10 @@
//
Properties properties = m_descriptor.getSystemProperties();
+ properties.setProperty( "dpml.station.key", m_id );
properties.setProperty( "dpml.subprocess", "true" );
- properties.setProperty( "dpml.station.partition", "depot.station." +
m_id );
+ properties.setProperty( "dpml.station.partition",
"depot.station.${dpml.station.key}" );
+ properties.setProperty( "dpml.station.logging.dir",
"${dpml.data}/logs/station" );
//
// BIG ISSUE: if the following is enabled we hit errors that seem to
be
@@ -342,12 +348,15 @@
//}
//
- if( null == properties.getProperty( "java.util.logging.config.class"
) )
- {
- properties.setProperty(
- "java.util.logging.config.class",
- "net.dpml.depot.DepotLoggingConfiguration" );
- }
+ //if( null == properties.getProperty(
"java.util.logging.config.class" ) )
+ //{
+ // properties.setProperty(
+ // "java.util.logging.config.class",
+ // "net.dpml.depot.DepotLoggingConfiguration" );
+ //}
+
+ properties.setProperty( "dpml.logging.config",
"local:properties:dpml/station/application" );
+
Enumeration names = properties.propertyNames();
while( names.hasMoreElements() )
{
@@ -375,6 +384,14 @@
return (String[]) list.toArray( new String[0] );
}
+ private void setupLoggingDirectory()
+ {
+ File logs = new File( Transit.DPML_DATA, "logs" );
+ File station = new File( logs, "station" );
+ File target = new File( station, m_id );
+ target.mkdirs();
+ }
+
/**
* Stop the application.
* @exception RemoteException if a rmote error occurs
- r1267 - in trunk/main/station: exec/src/main/net/dpml/station/exec server/etc/prefs/propertiess server/etc/prefs/xmls server/src/main/net/dpml/station/server, mcconnell at BerliOS, 03/24/2006
Archive powered by MHonArc 2.6.24.