geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r617213 - in /geronimo/server: branches/2.0/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/logmanager/ branches/2.0/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/logman...
Date Thu, 31 Jan 2008 20:20:41 GMT
Author: vamsic007
Date: Thu Jan 31 12:20:33 2008
New Revision: 617213

URL: http://svn.apache.org/viewvc?rev=617213&view=rev
Log:
Once the Config File is changed from LogManagerPortlet, the logFile used by LogViewerPortlet
should be changed to the one from new configuration or else it will result in an error.

Modified:
    geronimo/server/branches/2.0/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java
    geronimo/server/branches/2.0/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/logmanager/view.jsp
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/resources/consolebase.properties
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/logmanager/view.jsp

Modified: geronimo/server/branches/2.0/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java?rev=617213&r1=617212&r2=617213&view=diff
==============================================================================
--- geronimo/server/branches/2.0/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java
(original)
+++ geronimo/server/branches/2.0/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java
Thu Jan 31 12:20:33 2008
@@ -34,6 +34,9 @@
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.system.logging.SystemLog;
 
+/**
+ * @version $Rev$ $Date$
+ */
 public class LogViewerPortlet extends BasePortlet {
     private final static String CRITERIA_KEY = "org.apache.geronimo.console.log.CRITERIA";
 
@@ -61,6 +64,23 @@
         }
         Criteria criteria = (Criteria) renderRequest.getPortletSession(true).getAttribute(CRITERIA_KEY,
PortletSession.PORTLET_SCOPE);
         
+        if(criteria != null) {
+            // Check if criteria.logFile is in the logFileNames of current configuration
+            boolean found = false;
+            for(String logFile: logFiles) {
+                if(criteria.logFile.equals(new File(logFile))) {
+                    found = true;
+                    break;
+                }
+            }
+            if(!found) {
+                // This arises when log4j properties file is changed dynamically using LogManagerPortlet
+                // and the earlier log file is no longer in the current logging configuration.
+                // Change the log file to any one in the current logging configuration so
that LogViewer
+                // won't run into errors.
+                criteria.logFile = logFiles[0];
+            }
+        }
         if (criteria == null || (action != null && !"refresh".equals(action))) {
             if(criteria == null)
                 criteria = new Criteria();

Modified: geronimo/server/branches/2.0/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/logmanager/view.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/logmanager/view.jsp?rev=617213&r1=617212&r2=617213&view=diff
==============================================================================
--- geronimo/server/branches/2.0/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/logmanager/view.jsp
(original)
+++ geronimo/server/branches/2.0/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/logmanager/view.jsp
Thu Jan 31 12:20:33 2008
@@ -49,6 +49,9 @@
 }
 </script>
 
+<b>Note:</b> Updated values will take effect for only this run of the server
and will reset to default values once the server is
+stopped.  The Config File value can be overridden at server startup by using <i>org.apache.geronimo.log4jservice.configuration</i>
system property.
+<p/>
 <form name="<portlet:namespace/>update" action="<portlet:actionURL/>" onsubmit="return
<portlet:namespace/>validateForm()">
 <input type="hidden" name="action" value="update"/>
 <table width="680">

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java?rev=617213&r1=617212&r2=617213&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java
Thu Jan 31 12:20:33 2008
@@ -38,6 +38,9 @@
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.system.logging.SystemLog;
 
+/**
+ * @version $Rev$ $Date$
+ */
 public class LogViewerPortlet extends BasePortlet {
     private final static String CRITERIA_KEY = "org.apache.geronimo.console.log.CRITERIA";
 
@@ -73,6 +76,23 @@
         }
         Criteria criteria = (Criteria) renderRequest.getPortletSession(true).getAttribute(CRITERIA_KEY,
PortletSession.PORTLET_SCOPE);
         
+        if(criteria != null) {
+            // Check if criteria.logFile is in the logFileNames of current logging configuration
+            boolean found = false;
+            for(String logFile: logFiles) {
+                if(criteria.logFile.equals(new File(logFile))) {
+                    found = true;
+                    break;
+                }
+            }
+            if(!found) {
+                // This arises when log4j properties file is changed dynamically using LogManagerPortlet
+                // and the earlier log file is no longer in the current logging configuration.
+                // Change the log file to any one in the current logging configuration so
that LogViewer
+                // won't run into errors.
+                criteria.logFile = logFiles[0];
+            }
+        }
         if (criteria == null || (action != null && !"refresh".equals(action))) {
             if(criteria == null)
                 criteria = new Criteria();

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/resources/consolebase.properties
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/resources/consolebase.properties?rev=617213&r1=617212&r2=617213&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/resources/consolebase.properties
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/resources/consolebase.properties
Thu Jan 31 12:20:33 2008
@@ -306,6 +306,7 @@
 logmanager.common.filterCriteria                  = Filter Criteria:
 logmanager.common.logLevel                        = Log Level<i>
 logmanager.common.refreshPeriod                   = Refresh Period
+logmanager.common.title                           = <b>Note:</b> Updated values
will take effect for only this run of the server and will reset to default values once the
server is stopped.  The Config File value can be overridden at server startup by using <i>org.apache.geronimo.log4jservice.configuration</i>
system property.
 logmanager.help.configFileExplanation             = Another configuration file can be used
by entering a different path and file name in the Config file text box.
 logmanager.help.introduction                      = <p>This portlet allows the user
to temporarily select a configuration file for logging and/or change the log level and Refresh
period. The default &quot;Config file&quot; is a standard log4j file and defines the
location where the Geronimo Server will log Geronimo output. The configuration file also defines
the log level, the maximum log file size,  and other attributes associated with logging. <br>
<br>   Gereonimo Console will display output from the Geronimo log file in the Server
Log Viewer portlet in the next window pane.</p>
 logmanager.help.logLevelExplanation               = The user may select a level for logging
from the drop-down menu.

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/logmanager/view.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/logmanager/view.jsp?rev=617213&r1=617212&r2=617213&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/logmanager/view.jsp
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/logmanager/view.jsp
Thu Jan 31 12:20:33 2008
@@ -51,6 +51,8 @@
 }
 </script>
 
+<fmt:message key="logmanager.common.title"/>
+<p/>
 <form name="<portlet:namespace/>update" action="<portlet:actionURL/>" onsubmit="return
<portlet:namespace/>validateForm()">
 <input type="hidden" name="action" value="update"/>
 <table width="680">



Mime
View raw message