You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2018/09/23 17:51:18 UTC

[1/4] logging-log4j-audit git commit: [LOG4J2-2440]

Repository: logging-log4j-audit
Updated Branches:
  refs/heads/master 8f460ee02 -> f4dee64be


[LOG4J2-2440]


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

Branch: refs/heads/master
Commit: 5e67a33704d0a768b6adb41533e7966489f4072f
Parents: 07e5419
Author: Andrei Ivanov <an...@arnia.ro>
Authored: Sun Sep 23 15:17:02 2018 +0300
Committer: Andrei Ivanov <an...@arnia.ro>
Committed: Sun Sep 23 15:17:02 2018 +0300

----------------------------------------------------------------------
 .../org/apache/logging/log4j/audit/LogEventFactory.java |  4 ++++
 .../java/org/apache/logging/log4j/audit/LoginTest.java  | 12 ++++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/5e67a337/log4j-audit/log4j-audit-api/src/main/java/org/apache/logging/log4j/audit/LogEventFactory.java
----------------------------------------------------------------------
diff --git a/log4j-audit/log4j-audit-api/src/main/java/org/apache/logging/log4j/audit/LogEventFactory.java b/log4j-audit/log4j-audit-api/src/main/java/org/apache/logging/log4j/audit/LogEventFactory.java
index 2362a50..6356908 100644
--- a/log4j-audit/log4j-audit-api/src/main/java/org/apache/logging/log4j/audit/LogEventFactory.java
+++ b/log4j-audit/log4j-audit-api/src/main/java/org/apache/logging/log4j/audit/LogEventFactory.java
@@ -263,6 +263,10 @@ public class LogEventFactory {
         @SuppressWarnings("unchecked")
 		public Object invoke(Object o, Method method, Object[] objects)
 				throws Throwable {
+            if (method.getName().equals("toString") && method.getParameterCount() == 0) {
+                return msg.toString();
+            }
+
 			if (method.getName().equals("logEvent")) {
 
 				StringBuilder errors = new StringBuilder();

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/5e67a337/log4j-audit/log4j-audit-api/src/test/java/org/apache/logging/log4j/audit/LoginTest.java
----------------------------------------------------------------------
diff --git a/log4j-audit/log4j-audit-api/src/test/java/org/apache/logging/log4j/audit/LoginTest.java b/log4j-audit/log4j-audit-api/src/test/java/org/apache/logging/log4j/audit/LoginTest.java
index 190ccd6..789abde 100644
--- a/log4j-audit/log4j-audit-api/src/test/java/org/apache/logging/log4j/audit/LoginTest.java
+++ b/log4j-audit/log4j-audit-api/src/test/java/org/apache/logging/log4j/audit/LoginTest.java
@@ -6,11 +6,19 @@ import org.junit.Test;
 import java.util.Collections;
 import java.util.List;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
 
 public class LoginTest extends BaseEventTest {
     @Test
+    public void testAuditClassToString() {
+        Login event = LogEventFactory.getEvent(Login.class);
+        event.setCompletionStatus("Success");
+        String string = event.toString();
+
+        assertEquals("[login completionStatus=\"Success\"]", string);
+    }
+
+    @Test
     public void testAuditClass() {
         Login event = LogEventFactory.getEvent(Login.class);
 


[3/4] logging-log4j-audit git commit: Closes #11

Posted by rg...@apache.org.
Closes #11


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

Branch: refs/heads/master
Commit: f8ec09bcc7684b509e9f4ac48ea7b6b06098ef28
Parents: 8f460ee cb7bed4
Author: Ralph Goers <rg...@apache.org>
Authored: Sun Sep 23 07:48:50 2018 -1000
Committer: Ralph Goers <rg...@apache.org>
Committed: Sun Sep 23 07:48:50 2018 -1000

----------------------------------------------------------------------
 .../org/apache/logging/log4j/audit/LogEventFactory.java     | 4 ++++
 .../test/java/org/apache/logging/log4j/audit/LoginTest.java | 9 +++++++++
 2 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f8ec09bc/log4j-audit/log4j-audit-api/src/main/java/org/apache/logging/log4j/audit/LogEventFactory.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f8ec09bc/log4j-audit/log4j-audit-api/src/test/java/org/apache/logging/log4j/audit/LoginTest.java
----------------------------------------------------------------------


[4/4] logging-log4j-audit git commit: LOG4J2-2440 - AuditEvents should provide some basic toString()

Posted by rg...@apache.org.
LOG4J2-2440 - AuditEvents should provide some basic toString()


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

Branch: refs/heads/master
Commit: f4dee64be09c2614a4da834c67a89276ba4daa7b
Parents: f8ec09b
Author: Ralph Goers <rg...@apache.org>
Authored: Sun Sep 23 07:50:31 2018 -1000
Committer: Ralph Goers <rg...@apache.org>
Committed: Sun Sep 23 07:50:31 2018 -1000

----------------------------------------------------------------------
 src/changes/changes.xml | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f4dee64b/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 513bc9f..7b7256f 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -31,6 +31,9 @@
          - "remove" - Removed
     -->
     <release version="1.0.1" date="YYYY-MM-DD" description="Release 1.0.1">
+      <action issue="LOG4J2-2440" dev="rgoers" type="fix" due-to="Andrei Ivanov">
+        AuditEvents should provide some basic toString().
+      </action>
       <action issue="LOG4J2-2429" dev="rgoers" type="fix" due-to="Andrei Ivanov">
         Setting the exceptionHandler on the AuditEvent sets it as a ThreadContext variable.
       </action>


[2/4] logging-log4j-audit git commit: [LOG4J2-2420] use same formatting as surrounding lines

Posted by rg...@apache.org.
[LOG4J2-2420] use same formatting as surrounding lines


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

Branch: refs/heads/master
Commit: cb7bed47e2267c1a130be9df5eedfa3e7ec337e8
Parents: 5e67a33
Author: Andrei Ivanov <an...@arnia.ro>
Authored: Sun Sep 23 15:18:36 2018 +0300
Committer: Andrei Ivanov <an...@arnia.ro>
Committed: Sun Sep 23 15:18:36 2018 +0300

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


http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/cb7bed47/log4j-audit/log4j-audit-api/src/main/java/org/apache/logging/log4j/audit/LogEventFactory.java
----------------------------------------------------------------------
diff --git a/log4j-audit/log4j-audit-api/src/main/java/org/apache/logging/log4j/audit/LogEventFactory.java b/log4j-audit/log4j-audit-api/src/main/java/org/apache/logging/log4j/audit/LogEventFactory.java
index 6356908..71cefe0 100644
--- a/log4j-audit/log4j-audit-api/src/main/java/org/apache/logging/log4j/audit/LogEventFactory.java
+++ b/log4j-audit/log4j-audit-api/src/main/java/org/apache/logging/log4j/audit/LogEventFactory.java
@@ -263,9 +263,9 @@ public class LogEventFactory {
         @SuppressWarnings("unchecked")
 		public Object invoke(Object o, Method method, Object[] objects)
 				throws Throwable {
-            if (method.getName().equals("toString") && method.getParameterCount() == 0) {
-                return msg.toString();
-            }
+			if (method.getName().equals("toString") && method.getParameterCount() == 0) {
+				return msg.toString();
+			}
 
 			if (method.getName().equals("logEvent")) {