You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2006/12/02 11:26:11 UTC

svn commit: r481544 - in /incubator/ofbiz/trunk/framework: base/config/debug.properties images/webapp/images/maincss.css webtools/webapp/webtools/WEB-INF/actions/log/LogView.bsh webtools/webapp/webtools/log/logContent.ftl webtools/widget/LogScreens.xml

Author: jacopoc
Date: Sat Dec  2 02:26:09 2006
New Revision: 481544

URL: http://svn.apache.org/viewvc?view=rev&rev=481544
Log:
Misc improvements to the Webtools log view screen:
- added a new log file appender that decorates the log messages with css; the content of this file is shown by the Webtools screen
- log messages containing ${...} notations are now supported
OFBIZ-361
Thanks to Chris Howe for most of this work.

Added:
    incubator/ofbiz/trunk/framework/webtools/webapp/webtools/log/logContent.ftl   (with props)
Modified:
    incubator/ofbiz/trunk/framework/base/config/debug.properties
    incubator/ofbiz/trunk/framework/images/webapp/images/maincss.css
    incubator/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/log/LogView.bsh
    incubator/ofbiz/trunk/framework/webtools/widget/LogScreens.xml

Modified: incubator/ofbiz/trunk/framework/base/config/debug.properties
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/base/config/debug.properties?view=diff&rev=481544&r1=481543&r2=481544
==============================================================================
--- incubator/ofbiz/trunk/framework/base/config/debug.properties (original)
+++ incubator/ofbiz/trunk/framework/base/config/debug.properties Sat Dec  2 02:26:09 2006
@@ -31,7 +31,7 @@
 print.fatal=true
 
 # Set root logger priority and appender
-log4j.rootLogger=ALL, stdout, file
+log4j.rootLogger=ALL, stdout, file, css
   
 # Special OFBiz log4j configuration - set all top levels to true and set root to ALL
 log4j.logger.NoModule=ALL
@@ -80,6 +80,15 @@
 
 log4j.appender.file.layout=org.apache.log4j.PatternLayout
 log4j.appender.file.layout.ConversionPattern=%d (%t) [%24F:%-3L:%-5p]%x %m%n
+
+#--- CSS Log ---
+log4j.appender.css=org.apache.log4j.RollingFileAppender
+log4j.appender.css.File=framework/logs/ofbiz.html
+log4j.appender.css.MaxFileSize=200KB
+log4j.appender.css.MaxBackupIndex=1
+log4j.appender.css.DatePattern='.'yyyy-MM-dd-HH-mm'.html'
+log4j.appender.css.layout=org.apache.log4j.PatternLayout
+log4j.appender.css.layout.ConversionPattern=<div class=%p>%d (%t) [%24F:%-3L:%-5p]%x %m </div>%n
 
 #--- EXAMPLE ---
 log4j.appender.A2=org.apache.log4j.ConsoleAppender

Modified: incubator/ofbiz/trunk/framework/images/webapp/images/maincss.css
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/images/webapp/images/maincss.css?view=diff&rev=481544&r1=481543&r2=481544
==============================================================================
--- incubator/ofbiz/trunk/framework/images/webapp/images/maincss.css (original)
+++ incubator/ofbiz/trunk/framework/images/webapp/images/maincss.css Sat Dec  2 02:26:09 2006
@@ -1043,3 +1043,32 @@
 width: 100%;
 border: 1px solid #999999;
 }
+
+/* ==== Styles For The Html Log === */
+.DEBUG{
+font-size: 10px;
+text-decoration: none;
+font-family: Verdana, Arial, Helvetica, sans-serif;
+color:grey;
+}
+.WARN{
+font-size: 10px;
+text-decoration: none;
+font-family: Verdana, Arial, Helvetica, sans-serif;
+font-weight:bold;
+color:blue;
+}
+.INFO{
+font-size: 10px;
+text-decoration: none;
+font-family: Verdana, Arial, Helvetica, sans-serif;
+color:green;
+}
+.ERROR{
+font-size: 10px;
+text-decoration: none;
+font-family: Verdana, Arial, Helvetica, sans-serif;
+font-weight:bold;
+color:red;
+border: 2px solid red;
+}

Modified: incubator/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/log/LogView.bsh
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/log/LogView.bsh?view=diff&rev=481544&r1=481543&r2=481544
==============================================================================
--- incubator/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/log/LogView.bsh (original)
+++ incubator/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/log/LogView.bsh Sat Dec  2 02:26:09 2006
@@ -21,5 +21,5 @@
     sb = FileUtil.readTextFile(logFileName, true);
 } catch(Exception exc) {}
 if (sb != null) {
-    context.put("logFileContent", sb.toString().replaceAll(System.getProperty("line.separator"), "<br/>"));
+    context.put("logFileContent", sb.toString());
 }

Added: incubator/ofbiz/trunk/framework/webtools/webapp/webtools/log/logContent.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/webtools/webapp/webtools/log/logContent.ftl?view=auto&rev=481544
==============================================================================
--- incubator/ofbiz/trunk/framework/webtools/webapp/webtools/log/logContent.ftl (added)
+++ incubator/ofbiz/trunk/framework/webtools/webapp/webtools/log/logContent.ftl Sat Dec  2 02:26:09 2006
@@ -0,0 +1,17 @@
+<#--
+Copyright 2001-2006 The Apache Software Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations
+under the License.
+-->
+
+${logFileContent?if_exists}

Propchange: incubator/ofbiz/trunk/framework/webtools/webapp/webtools/log/logContent.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/ofbiz/trunk/framework/webtools/webapp/webtools/log/logContent.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: incubator/ofbiz/trunk/framework/webtools/webapp/webtools/log/logContent.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/ofbiz/trunk/framework/webtools/widget/LogScreens.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/webtools/widget/LogScreens.xml?view=diff&rev=481544&r1=481543&r2=481544
==============================================================================
--- incubator/ofbiz/trunk/framework/webtools/widget/LogScreens.xml (original)
+++ incubator/ofbiz/trunk/framework/webtools/widget/LogScreens.xml Sat Dec  2 02:26:09 2006
@@ -67,7 +67,7 @@
         <set field="titleProperty" value="PageTitleLogView"/>
         <!-- TODO: the following command is not really working (and the default value is always used);
                    my guess is that the base/config/debug.properties file is not found in the classpath -->
-        <property-to-field resource="debug" property="debug.log4j.appender.file.File" field="logFileName" default="framework/logs/ofbiz.log" no-locale="true"/>
+        <property-to-field resource="debug" property="log4j.appender.css.File" field="logFileName" default="framework/logs/ofbiz.html" no-locale="true"/>
         <script location="component://webtools/webapp/webtools/WEB-INF/actions/log/LogView.bsh"/>
       </actions>
       <widgets>
@@ -84,9 +84,9 @@
                 <label style="tableheadtext">${uiLabelMap.WebtoolsLogFileName}:</label>
                 <label style="tabletext">${logFileName}</label>
             </container>
-            <container>
-                <label style="tabletext">${logFileContent}</label>
-            </container>
+            <platform-specific>
+                <html><html-template location="component://webtools/webapp/webtools/log/logContent.ftl"/></html>
+            </platform-specific>
           </decorator-section>
         </decorator-screen>
       </widgets>