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 theSqlEvent
and theSqlFirewallManager
class name into aLogger
with parameters: Name:JsonLoggerUpdateListener
File name pattern:user.home/.kawansoft/log/JsonLoggerUpdateListener_%d.log.%i
(example of file created:JsonLoggerUpdateListener_2024-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 aJsonLoggerUpdateListener.properties
file inuser.home/.kawansoft/conf
.
-
Constructor Details
-
JsonLoggerUpdateListener
public JsonLoggerUpdateListener()
-
-
Method Details
-
updateActionPerformed
public void updateActionPerformed(SqlEvent evt, Connection connection) throws IOException, SQLExceptionLogs using JSON format theSqlEvent
and theSqlFirewallManager
class name into aLogger
with parameters:- Name:
JsonLoggerUpdateListener
- File name pattern:
user.home/.kawansoft/log/JsonLoggerUpdateListener_%d.log.%i
(example of file created:JsonLoggerUpdateListener_2024-07-01.log.1
.). - Pattern of each line of log:
"%msg%n"
- Maximum File Size: 300Mb
- Total Size Cap: 30Gb
JsonLoggerUpdateListener.properties
file inuser.home/.kawansoft/conf
.
See the JsonLoggerUpdateListener.properties format.
- Specified by:
updateActionPerformed
in interfaceUpdateListener
- Parameters:
evt
- the SQL update event that is successfully processedconnection
- the Connection in use for the SQL update event- Throws:
IOException
- if an IOException occursSQLException
- if a SQLException occurs
- Name:
-
getLoggerElements
Returns the Logger elements (for debug purpose)- Returns:
- the lOGGER_ELEMENTS
-