diff options
author | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2018-09-13 09:13:17 +0200 |
---|---|---|
committer | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2018-09-13 09:13:17 +0200 |
commit | 40e2aa80025083f017ae521704d853e4a4ac9267 (patch) | |
tree | d98e04d5224c280739b10ce02223e4dd75bb0820 /connector | |
parent | 29072690ca2afe6b8282214e4b7aab53337f6f55 (diff) | |
download | National_eIDAS_Gateway-40e2aa80025083f017ae521704d853e4a4ac9267.tar.gz National_eIDAS_Gateway-40e2aa80025083f017ae521704d853e4a4ac9267.tar.bz2 National_eIDAS_Gateway-40e2aa80025083f017ae521704d853e4a4ac9267.zip |
update RevisionLogger.java to make IP address logging optional
Diffstat (limited to 'connector')
-rw-r--r-- | connector/src/main/java/at/asitplus/eidas/specific/connector/logger/RevisionLogger.java | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/connector/src/main/java/at/asitplus/eidas/specific/connector/logger/RevisionLogger.java b/connector/src/main/java/at/asitplus/eidas/specific/connector/logger/RevisionLogger.java index 1d29d96b..22e31fa8 100644 --- a/connector/src/main/java/at/asitplus/eidas/specific/connector/logger/RevisionLogger.java +++ b/connector/src/main/java/at/asitplus/eidas/specific/connector/logger/RevisionLogger.java @@ -4,17 +4,23 @@ import java.util.Date; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import at.asitplus.eidas.specific.connector.MSeIDASNodeConstants; import at.gv.egiz.components.eventlog.api.Event; +import at.gv.egiz.components.eventlog.api.EventConstants; import at.gv.egiz.components.eventlog.api.EventLogFactory; import at.gv.egiz.components.eventlog.api.EventLoggingException; import at.gv.egiz.eaaf.core.api.IRequest; +import at.gv.egiz.eaaf.core.api.idp.IConfiguration; import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration; import at.gv.egiz.eaaf.core.api.logging.IRevisionLogger; public class RevisionLogger extends EventLogFactory implements IRevisionLogger { private static final Logger log = LoggerFactory.getLogger(RevisionLogger.class); - + + @Autowired private IConfiguration basicConfig; + @Override public void logEvent(ISPConfiguration oaConfig, int eventCode, String message) { logEvent(createNewEvent(new Date().getTime(), eventCode, message)); @@ -55,9 +61,18 @@ public class RevisionLogger extends EventLogFactory implements IRevisionLogger { private void logEvent(Event event) { try { - if (event.getEventCode() >= 1100) + if (event.getEventCode() >= 1100) { + if ( (event.getEventCode() == EventConstants.TRANSACTION_IP) + && !basicConfig.getBasicMOAIDConfigurationBoolean( + MSeIDASNodeConstants.PROP_CONFIG_REVISIONLOG_LOG_IP_ADDRESS_OF_USER, true) ) { + log.trace("Ignore Event: " + event.getEventCode() + " because IP adresse logging prohibited"); + return; + + } + getEventLog().logEvent(event); - else + + } else log.trace("Ignore Event: " + event.getEventCode() + " because session functionallity is not implemented"); } catch (EventLoggingException e) { |