[
https://issues.apache.org/jira/browse/OWB-375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870748#action_12870748
]
Paul J. Reder commented on OWB-375:
-----------------------------------
Ok, after a brief chat with Jacquelle and Mark about nuances related to this, I
am finally attaching a patch that I think addresses all concerns (and then
some). This patch:
1) Cleans up all log messages to make sure resource bundle is used for all logs
that are not debug or trace.
2) Uses formatting instead of "+" concatenation.
3) Adds wrapper methods to check if logging is enabled at each loglevel.
4) Wraps complex log calls with loglevel checks to avoid potential performance
issues.
5) Removes log messages from the resource bundle that are no longer used (code
was deleted).
> Performance: OWB logging performs operations when logging disabled.
> --------------------------------------------------------------------
>
> Key: OWB-375
> URL: https://issues.apache.org/jira/browse/OWB-375
> Project: OpenWebBeans
> Issue Type: Improvement
> Components: Core
> Affects Versions: 1.0.0
> Reporter: Jacquelle Leggett
> Assignee: Gurkan Erdogdu
> Priority: Minor
> Fix For: 1.1.0
>
>
> Logging operations in OWB code are not guarded by Logger.isLoggable(..) or
> something similar and results in Strings being processed when logging is
> disabled.
> Here's an example from AbstractInjectable:
> logger.debug("Injected into bean : " +
> this.injectionOwnerBean.toString() + " with injection point : " +
> injectionPoint);
> The String concatenation above will occur whether or not logging is enabled.
> WebBeansLogger should be modified so that the above can be changed to:
> if(logger.isDebugEnabed())
> logger.debug("Injected into bean : " +
> this.injectionOwnerBean.toString() + " with injection point : " +
> injectionPoint);
>
> Generally speaking, it's best for logging statements to be guarded by an
> isEnabled() flag to prevent performance impacts.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.