You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2016/04/03 16:36:48 UTC

[1/2] logging-log4j2 git commit: Documented meta-annotation values for @PerformanceSensitive

Repository: logging-log4j2
Updated Branches:
  refs/heads/master 2511a856e -> b77edb7ce


Documented meta-annotation values for @PerformanceSensitive


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/5ef9e112
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/5ef9e112
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/5ef9e112

Branch: refs/heads/master
Commit: 5ef9e112725525b7d0a414bf08b14b5f1fc4b8b8
Parents: 2511a85
Author: rpopma <rp...@apache.org>
Authored: Sun Apr 3 23:15:30 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sun Apr 3 23:15:30 2016 +0900

----------------------------------------------------------------------
 .../org/apache/logging/log4j/util/PerformanceSensitive.java    | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5ef9e112/log4j-api/src/main/java/org/apache/logging/log4j/util/PerformanceSensitive.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/PerformanceSensitive.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/PerformanceSensitive.java
index 6cd5926..694175c 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/PerformanceSensitive.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/PerformanceSensitive.java
@@ -17,6 +17,9 @@
 
 package org.apache.logging.log4j.util;
 
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
 /**
  * Indicates that a particular annotated construct was written with certain performance constraints in mind that
  * should be considered when modifying or testing. Descriptive values should be similar to the conventions used by
@@ -25,6 +28,9 @@ package org.apache.logging.log4j.util;
  *
  * @since 2.6
  */
+// Not @Documented: Do not (yet) make this annotation part of the public API of annotated elements.
+// No @Target: No restrictions yet on what code elements may be annotated or not.
+@Retention(RetentionPolicy.CLASS) // Currently no need to reflectively discover this annotation at runtime.
 public @interface PerformanceSensitive {
     /** Description of why this is written the way it is. */
     String[] value() default "";


[2/2] logging-log4j2 git commit: LOG4J2-1297 more polishing, added section on custom Messages

Posted by rp...@apache.org.
LOG4J2-1297 more polishing, added section on custom Messages


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/b77edb7c
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/b77edb7c
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/b77edb7c

Branch: refs/heads/master
Commit: b77edb7ce1a53f4ce9d87c9cab34ea8a3f90080a
Parents: 5ef9e11
Author: rpopma <rp...@apache.org>
Authored: Sun Apr 3 23:36:51 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sun Apr 3 23:36:51 2016 +0900

----------------------------------------------------------------------
 src/site/xdoc/manual/garbagefree.xml | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/b77edb7c/src/site/xdoc/manual/garbagefree.xml
----------------------------------------------------------------------
diff --git a/src/site/xdoc/manual/garbagefree.xml b/src/site/xdoc/manual/garbagefree.xml
index ba89bfb..a63506a 100644
--- a/src/site/xdoc/manual/garbagefree.xml
+++ b/src/site/xdoc/manual/garbagefree.xml
@@ -156,10 +156,10 @@
         <subsubsection name="Impact on Application Code: Autoboxing">
         <h4>Impact on Application Code: Autoboxing</h4>
         <p>
-          We made an effort to make existing application logging code garbage-free without requiring code changes,
+          We made an effort to make logging code garbage-free without requiring code changes in existing applications,
           but there is one area where this was not possible.
-          When logging primitive values (i.e. int, double, boolean, etc.),
-          autoboxing occurs and the JVM converts these primitive values to their Object wrapper equivalents.
+          When logging primitive values (i.e. int, double, boolean, etc.) the JVM
+          autoboxes these primitive values to their Object wrapper equivalents, creating garbage.
         </p>
         <p>
           Log4j provides an <tt>Unboxer</tt> utility to prevent autoboxing of primitive parameters.
@@ -216,6 +216,18 @@ public void garbageFree() {
           Custom Appenders that want to be garbage-free should provide their Layout with a
           <tt>ByteBufferDestination</tt> implementation that the Layout can directly write into.
         </p>
+        <p>
+          Custom Message implementations that implement <tt>org.apache.logging.log4j.util.StringBuilderFormattable</tt>
+          can be converted to text by PatternLayout without creating temporary objects.
+          Other layouts that convert LogEvents to text will likely also look for this interface.
+        </p>
+        <!--
+        <p>
+          TODO Applications that wish to reuse custom Message instances with Async Loggers should let
+          their Message classes implement the <tt>org.apache.logging.log4j.message.ReusableMessage</tt> interface.
+          TODO This is not sufficient: see LOG4J2-1342, would be nice if we could solve this in a generic way.
+        </p>
+        -->
       </subsection>
     </section>
   </body>