Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0006300Openbravo ERPA. Platformpublic2008-12-01 15:212009-04-21 11:09
marvintm 
mtaal 
highmajoralways
closedfixed 
5
 
 
Core
No
0006300: Log generated by Openbravo classes is not shown when applying a module
When a module is applied, a build of the system is performed. The log of this build is shown in a popup window. However, the log messages generated by Openbravo classes (such as the log generated by the update.database task) is not shown.

As these messages are shown when the task is manually called in the command line, this was tried to be solved by redirecting the standard output to the log. The fix worked in some systems (particularly, when Tomcat was run through Eclipse), but it gave an error (https://issues.openbravo.com/file_download.php?file_id=471&type=bug [^]) in others (specifically, when Tomcat was run through the command line), and therefore, the fix was disabled.

The class in which the fix was made (and then disabled) is org.openbravo.erpCommon.ad_process.ApplyModules.java.
Just install a module in Openbravo, and apply it. You will notice how the normal log of the update.database task is not shown.
platform1_sprint1
Issue History
2008-12-01 15:21marvintmNew Issue
2008-12-01 15:21marvintmAssigned To => mtaal
2008-12-01 15:21marvintmsf_bug_id0 => 2371394
2008-12-01 15:21marvintmRegression testing => No
2008-12-03 11:21mtaalNote Added: 0010933
2008-12-03 19:03pjuvaraPrioritynormal => high
2008-12-15 06:53mtaalTag Attached: platform1_sprint1
2008-12-16 17:58rafarodaStatusnew => acknowledged
2008-12-20 00:14svnbotCheckin
2008-12-20 00:14svnbotNote Added: 0011626
2008-12-20 00:14svnbotStatusacknowledged => resolved
2008-12-20 00:14svnbotResolutionopen => fixed
2008-12-20 00:14svnbotsvn_revision => 11435
2008-12-20 00:14svnbotCheckin
2008-12-20 00:14svnbotNote Added: 0011627
2008-12-20 00:14svnbotsvn_revision11435 => 195
2009-04-21 11:09psarobeStatusresolved => closed

Notes
(0010933)
mtaal   
2008-12-03 11:21   
Hi,
I would not redirect the System.out to the install window as then the output of all threads (i.e. all users) is visible there.

I propose the following approach:
- decide for which classes/activities we need to see logging output in the install window
- for these classes use a custom appender or a custom logger
- this custom logger/appender works as the logger/appender with one additional feature: the logger/appender class has a threadlocal member which can contain an outputstream
- when this threadlocal outputstream is set then the logger/appender also sends it's log messages to that outputstream (in addition to standard logging)
- the applymodules task sets the correct outputstream (the one from the httpresponse) in the threadlocal of the above classes.

Before implementing the above, what would be the classes in Openbravo which should log to the install window?
Is there any opinion on if a custom logger or a custom appender should be used? Custom logger can be done in the java code and makes the log4j.properties more standard.

gr. Martin
(0011626)
svnbot   
2008-12-20 00:14   
Repository: openbravo
Revision: 11435
Author: mtaal
Date: 2008-12-20 00:14:26 +0100 (Sat, 20 Dec 2008)

fixes issue 6300 log4j messages are now printed to output window

---
U trunk/build.xml
U trunk/config/log4j.lcf.template
U trunk/src/org/openbravo/erpCommon/utility/AntExecutor.java
U trunk/src/org/openbravo/erpCommon/utility/OBPrintStream.java
A trunk/src-core/src/org/openbravo/utils/OBLogAppender.java
U trunk/src-db/database/build.xml
U trunk/src-db/database/lib/dbsourcemanager.jar
A trunk/src-test/org/openbravo/test/ant/RestartTomcatTest.java
U trunk/src-test/org/openbravo/test/model/RuntimeModelTest.java
A trunk/src-test/org/openbravo/test/xml/ClientDataSetCompleteTest.java
---

https://dev.openbravo.com/websvn/openbravo/?rev=11435&sc=1 [^]
(0011627)
svnbot   
2008-12-20 00:14   
Repository: dbsourcemanager
Revision: 195
Author: mtaal
Date: 2008-12-20 00:14:34 +0100 (Sat, 20 Dec 2008)

fixes issue 6300 log4j messages are now printed to output window

---
U trunk/build.xml
U trunk/src/org/apache/ddlutils/DdlUtilsException.java
U trunk/src/org/openbravo/ddlutils/task/AlterDatabaseDataMod.java
---

https://dev.openbravo.com/websvn/dbsourcemanager/?rev=195&sc=1 [^]