Class JsonLoggerUpdateListener

java.lang.Object
org.kawanfw.sql.api.server.listener.JsonLoggerUpdateListener
All Implemented Interfaces:
UpdateListener

public class JsonLoggerUpdateListener
extends Object
implements UpdateListener
Concrete implementation of UpdateListener. The updateActionPerformed(ClientEvent, Connection) logs using JSON format the SqlEvent.
Since:
9.0
Author:
Nicolas de Pomereu
  • Constructor Summary

    Constructors
    Constructor Description
    JsonLoggerUpdateListener()  
  • Method Summary

    Modifier and Type Method Description
    static Map<String,​String> getLoggerElements()
    Returns the Logger elements (for debug purpose)
    void updateActionPerformed​(SqlEvent evt, Connection connection)
    Logs using JSON format the SqlEvent and the SqlFirewallManager class name into a Logger with parameters: Name: JsonLoggerUpdateListener File name pattern: user.home/.kawansoft/log/JsonLoggerUpdateListener_%d.log.%i (example of file created: JsonLoggerUpdateListener_2022-07-01.log.1.). Pattern of each line of log: "%msg%n" Maximum File Size: 300Mb Total Size Cap: 30Gb These default values may be superseded by creating a JsonLoggerUpdateListener.properties file in user.home/.kawansoft/conf.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JsonLoggerUpdateListener

      public JsonLoggerUpdateListener()
  • Method Details

    • updateActionPerformed

      public void updateActionPerformed​(SqlEvent evt, Connection connection) throws IOException, SQLException
      Logs using JSON format the SqlEvent and the SqlFirewallManager class name into a Logger with parameters:
      • Name: JsonLoggerUpdateListener
      • File name pattern: user.home/.kawansoft/log/JsonLoggerUpdateListener_%d.log.%i (example of file created: JsonLoggerUpdateListener_2022-07-01.log.1.).
      • Pattern of each line of log: "%msg%n"
      • Maximum File Size: 300Mb
      • Total Size Cap: 30Gb
      These default values may be superseded by creating a JsonLoggerUpdateListener.properties file in user.home/.kawansoft/conf.

      See the JsonLoggerUpdateListener.properties format.


      Specified by:
      updateActionPerformed in interface UpdateListener
      Parameters:
      evt - the SQL update event that is successfully processed
      connection - the Connection in use for the SQL update event
      Throws:
      IOException - if an IOException occurs
      SQLException - if a SQLException occurs
    • getLoggerElements

      public static Map<String,​String> getLoggerElements()
      Returns the Logger elements (for debug purpose)
      Returns:
      the lOGGER_ELEMENTS