[java-support] 02/04: Add logging.

Ian Young ian at iay.org.uk
Fri Aug 24 06:18:32 EDT 2018


This is an automated email from the git hooks/post-receive script.

iay pushed a commit to branch master
in repository java-support.

View the commit online:
http://git.shibboleth.net/view/?p=java-support.git;a=commit;h=6b18bee01000502d49cf0d2b5d6801b37362f16a

commit 6b18bee01000502d49cf0d2b5d6801b37362f16a
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Aug 15 15:50:43 2018 -0400

    Add logging.
---
 .../utilities/java/support/security/IPRangeAccessControl.java  | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/main/java/net/shibboleth/utilities/java/support/security/IPRangeAccessControl.java b/src/main/java/net/shibboleth/utilities/java/support/security/IPRangeAccessControl.java
index c4709e7..8db135e 100644
--- a/src/main/java/net/shibboleth/utilities/java/support/security/IPRangeAccessControl.java
+++ b/src/main/java/net/shibboleth/utilities/java/support/security/IPRangeAccessControl.java
@@ -84,16 +84,20 @@ public class IPRangeAccessControl extends AbstractIdentifiableInitializableCompo
                 final byte[] resolvedAddress = InetAddresses.forString(addr).getAddress();
                 for (final IPRange range : allowedRanges) {
                     if (range.contains(resolvedAddress)) {
+                        log.debug("{} Granted access to client address '{}' (Operation: {}, Resource: {})",
+                                new Object[] {getLogPrefix(), addr, operation, resource});
                         return true;
                     }
                 }
             } catch (final IllegalArgumentException e) {
-                log.warn(getLogPrefix() + " Error translating client address", e);
+                log.warn("{} Error translating client address", getLogPrefix(), e);
             }
             
-            log.warn("{} Denied request from client address '{}'", getLogPrefix(), addr);
+            log.warn("{} Denied request from client address '{}' (Operation: {}, Resource: {})",
+                    new Object[] {getLogPrefix(), addr, operation, resource});
         } else {
-            log.warn("{} No client address, access denied", getLogPrefix());
+            log.warn("{} Denied request from client address 'unknown' (Operation: {}, Resource: {})",
+                    new Object[] {getLogPrefix(), operation, resource});
         }
         
         return false;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list