Class JsonLoggerSqlFirewallTrigger
java.lang.Object
org.kawanfw.sql.api.server.firewall.trigger.JsonLoggerSqlFirewallTrigger
- All Implemented Interfaces:
SqlFirewallTrigger
public class JsonLoggerSqlFirewallTrigger extends Object implements SqlFirewallTrigger
A trigger that will log using JSON format the
SqlEvent info
and the sqlFirewallManager class name.- Since:
- 11.0
- Author:
- Nicolas de Pomereu
-
Constructor Summary
Constructors Constructor Description JsonLoggerSqlFirewallTrigger() -
Method Summary
Modifier and Type Method Description voidrunIfStatementRefused(SqlEvent sqlEvent, SqlFirewallManager sqlFirewallManager, Connection connection)Logs using JSON format theClientEventand theSqlFirewallManagerclass name into aLoggerwith parameters: Output file pattern:user.home/.kawansoft/log/JsonLoggerSqlFirewallTrigger.log. Limit: 1Gb. Count (number of files to use): 3.
-
Constructor Details
-
JsonLoggerSqlFirewallTrigger
public JsonLoggerSqlFirewallTrigger()
-
-
Method Details
-
runIfStatementRefused
public void runIfStatementRefused(SqlEvent sqlEvent, SqlFirewallManager sqlFirewallManager, Connection connection) throws IOException, SQLExceptionLogs using JSON format theClientEventand theSqlFirewallManagerclass name into aLoggerwith parameters:- Output file pattern:
user.home/.kawansoft/log/JsonLoggerSqlFirewallTrigger.log. - Limit: 1Gb.
- Count (number of files to use): 3.
- Specified by:
runIfStatementRefusedin interfaceSqlFirewallTrigger- Parameters:
sqlEvent- the SQL event asked by the client side. Contains all info about the SQL call (client username, database name, IP Address of the client, and SQL statement details).sqlFirewallManager- the instance that triggers this call.connection- The current SQL/JDBCConnection- Throws:
IOException- if an IOException occursSQLException- if a SQLException occurs
- Output file pattern:
-