You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2014/10/25 17:49:02 UTC

[1/2] git commit: Better Javadocs.

Repository: logging-log4j2
Updated Branches:
  refs/heads/master cce13e43c -> b9a7d46b4


Better Javadocs.

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

Branch: refs/heads/master
Commit: 17e8c986534bba2e39694640ca8469d2f5b5460b
Parents: cce13e4
Author: Gary Gregory <ga...@gmail.com>
Authored: Fri Oct 24 17:09:30 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Fri Oct 24 17:09:30 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/logging/log4j/core/layout/GelfLayout.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/17e8c986/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/GelfLayout.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/GelfLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/GelfLayout.java
index dff0be9..704a589 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/GelfLayout.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/GelfLayout.java
@@ -43,10 +43,10 @@ import org.apache.logging.log4j.status.StatusLogger;
 import com.fasterxml.jackson.core.io.JsonStringEncoder;
 
 /**
- * Lays out Graylog Extended Log Format (GELF) 1.1 log events.
+ * Lays out events in the Graylog Extended Log Format (GELF) 1.1.
  * <p>
- * Compresses (compressionType = "GZIP" or "ZLIB") the JSON if log event data is larger than 1024 bytes (the
- * compressionThreshold). Does not implement chunking.
+ * This layout compresses JSON to GZIP or ZLIB (the {@code compressionType}) if log event data is larger than 1024 bytes
+ * (the {@code compressionThreshold}). This layout does not implement chunking.
  * </p>
  * <p>
  * Configure as follows to send to a Graylog2 server:


[2/2] git commit: Add GELF site documentation.

Posted by gg...@apache.org.
Add GELF site documentation.

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

Branch: refs/heads/master
Commit: b9a7d46b41f3bc9f672532030e92f52d8e1ec38f
Parents: 17e8c98
Author: Gary Gregory <ga...@gmail.com>
Authored: Sat Oct 25 11:48:53 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Sat Oct 25 11:48:53 2014 -0400

----------------------------------------------------------------------
 src/site/site.xml                   |  1 +
 src/site/xdoc/manual/layouts.xml.vm | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/b9a7d46b/src/site/site.xml
----------------------------------------------------------------------
diff --git a/src/site/site.xml b/src/site/site.xml
index 5fe54a6..0fbba13 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -137,6 +137,7 @@
         <item name="Serialized" href="/manual/layouts.html#SerializedLayout"/>
         <item name="Syslog" href="/manual/layouts.html#SyslogLayout"/>
         <item name="XML" href="/manual/layouts.html#XMLLayout"/>
+        <item name="GELF" href="/manual/layouts.html#GELFLayout"/>
         <item name="Location Information" href="/manual/layouts.html#LocationInformation"/>
       </item>
 

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/b9a7d46b/src/site/xdoc/manual/layouts.xml.vm
----------------------------------------------------------------------
diff --git a/src/site/xdoc/manual/layouts.xml.vm b/src/site/xdoc/manual/layouts.xml.vm
index 2365917..f17e4d5 100644
--- a/src/site/xdoc/manual/layouts.xml.vm
+++ b/src/site/xdoc/manual/layouts.xml.vm
@@ -1466,6 +1466,38 @@ at org.apache.logging.log4j.core.pattern.ExtendedThrowableTest.testException(Ext
           of course, end-of-lines.
           </p>
         </subsection>
+        <a name="GELFLayout"/>
+        <subsection name="GELF Layout">
+          <!-- From Javadoc of org.apache.logging.log4j.core.layout.GELFLayout -->
+          <p>
+            Lays out events in the Graylog Extended Log Format (GELF) 1.1.
+          </p>
+          <p>
+            This layout compresses JSON to GZIP or ZLIB (the <code>compressionType</code>) if log event data is larger than 1024 bytes
+            (the <code>compressionThreshold</code>). This layout does not implement chunking.
+          </p>
+          <p>
+            Configure as follows to send to a Graylog2 server:
+          </p>
+          <pre class="prettyprint linenums">[
+  &lt;Appenders&gt;
+    &lt;Socket name="Graylog" protocol="udp" host="graylog.domain.com" port="12201"&gt;
+        &lt;GelfLayout host="someserver" compressionType="GZIP" compressionThreshold="1024"&gt;
+            &lt;KeyValuePair key="additionalField1" value="additional value 1"/&gt;
+            &lt;KeyValuePair key="additionalField2" value="additional value 2"/&gt;
+        &lt;/GelfLayout&gt;
+    &lt;/Socket&gt;
+  &lt;/Appenders&gt;
+]
+</pre>
+           <p>
+             See also:
+           </p>
+           <ul>
+             <li>The <a href="http://graylog2.org/gelf">GELF home page</a></li>
+             <li>The <a href="http://graylog2.org/resources/gelf/specification">GELF specification</a></li>
+           </ul>
+        </subsection>
         <a name="LocationInformation"/>
         <subsection name="Location Information">
         <p>