Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0006182Openbravo ERPA. Platformpublic2008-11-24 16:182009-06-03 11:58
shuehner 
shuehner 
urgentminorN/A
closedfixed 
5
pi 
 
Core
No
0006182: Logging of this exception in HttpSecureAppServlet is done very badly
This issue is a spin-off of issue 6131 (part 4.):

Logging of Exception as (at least) the indicated source-code position has to be improved, as with the current code it is very hard to get all needed information.

4.) Logging of this exception is done very badly
    It is catched in HttpSecureAppServlet.java (line 262)
    Only the exception name is logged to log4j4j, not stacktrace
    the Stacktrace is printed on std-out
    Outcome: Info for this exception is spread over 2 log-files
    - openbravo.log for seeing "Error captured: NPE"
    - catalina.out (capturing std-out) for seeing the stacktrace without any timestamp and context information.

change the logging from

log4j.error("text..." + e.getMessage())
e.printStackTrace()

to

log4j.error("text...", e)
remove the printStackTrace line
verify that the exception (text + stacktrace) is correctly logged into the log4j logfile
250MP1
related to defect 0006131 closed gorka_gil Using "View details" on roks-module gives empty page with hidden NullPointerException 
depends on backport 0006553 closed shuehner Logging of this exception in HttpSecureAppServlet is done very badly 
blocks feature request 0006183 new Triage Platform Base Audit codebase and convert all <Exception>.printStackTrace() calls to proper log4j logging 
Issue History
2008-11-24 16:18shuehnerNew Issue
2008-11-24 16:18shuehnerAssigned To => rafaroda
2008-11-24 16:18shuehnersf_bug_id0 => 2339183
2008-11-24 16:18shuehnerRegression testing => No
2008-11-24 16:20shuehnerRelationship addedblocks 0006183
2008-11-24 16:21shuehnerRelationship addedrelated to 0006131
2008-12-15 09:40rafarodaStatusnew => scheduled
2008-12-15 09:40rafarodaAssigned Torafaroda => gmauleon
2008-12-15 09:40rafarodafix_in_branch => trunk
2008-12-15 15:09rafarodaIssue cloned0006553
2008-12-15 15:09rafarodaRelationship addeddepends on 0006553
2009-01-15 17:27gmauleonStatusscheduled => resolved
2009-01-15 17:27gmauleonFixed in Version => trunk
2009-01-15 17:27gmauleonsvn_revision => 11949
2009-01-15 17:27gmauleonResolutionopen => fixed
2009-04-21 12:36psarobeStatusresolved => closed
2009-04-27 15:34shuehnerStatusclosed => new
2009-04-27 15:34shuehnerResolutionfixed => open
2009-04-27 15:34shuehnerNote Added: 0015792
2009-04-27 15:34shuehnerFixed in Versionpi =>
2009-04-27 15:36shuehnerNote Added: 0015794
2009-04-27 15:54shuehnerTag Attached: 250MP1
2009-04-27 15:54shuehnerNote Added: 0015798
2009-04-28 13:30psarobePrioritynormal => urgent
2009-04-28 13:30psarobeStatusnew => scheduled
2009-04-28 13:30psarobefix_in_branchpi =>
2009-04-28 13:42shuehnerAssigned Togmauleon => shuehner
2009-05-13 11:00hgbotCheckin
2009-05-13 11:00hgbotNote Added: 0016314
2009-05-13 11:00hgbotStatusscheduled => resolved
2009-05-13 11:00hgbotResolutionopen => fixed
2009-05-13 11:00hgbotFixed in SCM revision11949 => http://code.openbravo.com/erp/devel/pi/rev/31eb902bcdec72bdfd2b7c9bb3b36b1c543529dd [^]
2009-06-03 11:58psarobeStatusresolved => closed

Notes
(0015792)
shuehner   
2009-04-27 15:34   
Some of the changes where not done correctly. The printStackTrace have been removed but not all log.error calls have been changed to the correct form using

log4j.error("text", exception)

instead of the wrong
log4j.error("test" + exception)
(0015794)
shuehner   
2009-04-27 15:36   
Needed changes:

- please check/convert all log4j.error("text" + exception), >= 6 cases which still use the +exception from (pi again)
- on the way please check for log4j.debug used for logging exception which must be .error ( one case using debug+error on (// Re-login in pi), and one just using debug instead of error to log an exception.
(0015798)
shuehner   
2009-04-27 15:54   
Adding tag 250mp1 after checking with rafa
(0016314)
hgbot   
2009-05-13 11:00   
Repository: erp/devel/pi
Changeset: 31eb902bcdec72bdfd2b7c9bb3b36b1c543529dd
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Wed May 13 11:00:04 2009 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/31eb902bcdec72bdfd2b7c9bb3b36b1c543529dd [^]

Fixed 6182: improve logging of exceptions (include stacktraces)

---
M src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
---