Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036527
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[Openbravo ERP] A. Platformminorhave not tried2017-07-24 11:472017-07-28 15:27
ReporteralostaleView Statuspublic 
Assigned Toalostale 
PrioritynormalResolutionfixedFixed in Version3.0PR17Q4
StatusclosedFix in branchFixed in SCM revision9c333865058f
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036527: OBException should not log itself by default

DescriptionCurrently default behavior of OBException constructors is to log the newly created instance including stack trace.

This, in most of the cases, creates unnecessary log.

Note this pattern is also used in many places, which makes things worse, as the exception including its stack trace is logged twice:
  
  try {
    ...
    if (failed) throw new OBException("Something failed");
  } catch (OBexception e) {
    log.error("Something failed", e);
    ...
  }
Steps To ReproduceWrite and execute:

new OBException("something failed");

check it generates log including stack trace
Proposed SolutionThis behavior is going to be changed so auto log will occur only if:
* It is explicitly indicated to constructor through boolean parameter
* Logger for the exception class is set to at least debug level

See: http://wiki.openbravo.com/wiki/How_To_Log#OBException [^]
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0036183 closedplatform Openbravo ERP Platform: EntityPersistenceEventObserver validations has a high log level 
related to defect 0036207 closedmarkmm82 Openbravo ERP Finance: EntityPersistenceEventObserver validations has a high log level 
related to defect 0036208 newRetail Retail Modules Retail: EntityPersistenceEventObserver validations has a high log level 
blocks design defect 0036162 acknowledgedTriage Platform Base Openbravo ERP clean up openbravo.log 

-  Notes
(0098195)
hgbot (developer)
2017-07-24 12:06

Repository: erp/devel/pi
Changeset: 9c333865058f015c5ee62ce023b95a1efd9210c3
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Jul 21 07:48:49 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/9c333865058f015c5ee62ce023b95a1efd9210c3 [^]

fixed 36527: OBException should not log itself by default

  Changed default OBException behavior: now it only logs itself on creation if
  explicitly set or if loger level is debug

---
M src/org/openbravo/base/exception/OBException.java
---
(0098263)
caristu (developer)
2017-07-28 15:27

Code reviewed + testing OK.

- Issue History
Date Modified Username Field Change
2017-07-24 11:47 alostale New Issue
2017-07-24 11:47 alostale Assigned To => platform
2017-07-24 11:47 alostale Modules => Core
2017-07-24 11:47 alostale Triggers an Emergency Pack => No
2017-07-24 11:48 alostale Description Updated View Revisions
2017-07-24 11:48 alostale Proposed Solution updated
2017-07-24 11:49 alostale Relationship added blocks 0036162
2017-07-24 11:49 alostale Assigned To platform => alostale
2017-07-24 12:05 alostale Review Assigned To => caristu
2017-07-24 12:06 alostale Relationship added related to 0036183
2017-07-24 12:06 hgbot Checkin
2017-07-24 12:06 hgbot Note Added: 0098195
2017-07-24 12:06 alostale Relationship added related to 0036207
2017-07-24 12:06 hgbot Status new => resolved
2017-07-24 12:06 hgbot Resolution open => fixed
2017-07-24 12:06 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/9c333865058f015c5ee62ce023b95a1efd9210c3 [^]
2017-07-24 12:07 alostale Relationship added related to 0036208
2017-07-28 15:27 caristu Note Added: 0098263
2017-07-28 15:27 caristu Status resolved => closed
2017-07-28 15:27 caristu Fixed in Version => 3.0PR17Q4


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker