[jboss-jira] [JBoss JIRA] Commented: (JBLOGGING-52) Use of system property for proxy generation setting is too inflexible
David Lloyd (JIRA)
jira-events at lists.jboss.org
Tue Dec 21 18:14:17 EST 2010
[ https://issues.jboss.org/browse/JBLOGGING-52?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571815#comment-12571815 ]
David Lloyd commented on JBLOGGING-52:
--------------------------------------
To Pete: yes, this is possible, however the reason this isn't the default behavior is that there can be surprising adverse performance effects to doing this. Even if you do log a message, since this is in fact the logging framework that we're talking about, there is a lot that can go wrong: the log message might be logged before there is even a logger, the log message might be filtered out, etc. The consequence to this is that your application might suddenly appear to have massively slowed down without any visible reason as to why.
To Dan: I think a more realistic long-term solution would be to look at the possibility of runtime generation of these classes somehow. The proxy solution that is in there now is exceedingly crappy and is the result of about 10 minutes of thought. If people truly want to skip the tooling then by generating these things at runtime is the best option because there's only a one-time performance hit; after that, runtime performance is not impacted. However, it would be a lot of work, so it's not even nearly on my radar, though I wouldn't mind abusing our current volunteer crowd to achieve this goal if it's very important and if they're willing and able to do so.
> Use of system property for proxy generation setting is too inflexible
> ---------------------------------------------------------------------
>
> Key: JBLOGGING-52
> URL: https://issues.jboss.org/browse/JBLOGGING-52
> Project: JBoss Logging
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: jboss-logging-spi
> Affects Versions: 3.0.0.Beta4-jboss-logging
> Reporter: Dan Allen
> Assignee: Dan Allen
> Fix For: 3.0.0.Beta5-jboss-logging
>
>
> JBoss Logging uses a system property to configure whether or not proxies are generated for type-safe loggers. This approach is very inflexible.
> The main issue is that the value of this system property is being cached too aggressively. In CDI extensions, we are forced to use a static code block to set the property so it is assigned early enough that JBoss Logging caches the correct value. However, with multiple extensions loading in a non-deterministic order, we end up having to put this static block in multiple places. [1]
> We need a better way to apply this setting. Perhaps a static method on a configuration API to assign the value before any logging takes place.
> [1] https://github.com/seam/solder/blob/master/impl/src/main/java/org/jboss/seam/solder/log/LoggerExtension.java
> https://github.com/seam/servlet/blob/master/impl/src/main/java/org/jboss/seam/servlet/ServletExtension.java
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list