This article covers loggers related to Databases that were introduced in Ignition version 7.9.X.
Loggers in this article:
gateway.Database
A series of loggers for monitoring database connections and individual queries. Replaced 7.8’s DatabaseConnectionManager.
gateway.Database
- Will report any connection issues sent back from the database server itself. {DatabaseConnectionProfileName} is denoted as the name of an existing database connection profile.
-
DEBUG log that provides the error sent back from a failed connection to a MySQL database:
Database connection validity test failed.
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
...
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
...
Caused by: java.net.ConnectException: Connection refused: connect
...
-
DEBUG log that provides the error sent back from a failed connection to a MySQL database:
gateway.Database.Selects
- Allows you to monitor specific queries down to the exact syntax being executed against a database. It will not provide values of dynamic parameters.
-
TRACE log from Selects showing a SELECT statement for a running, real-time Easy Chart trending Tag History. The origin of the query can be traced using the information provided ( request-origin, session-user, session-project):
SELECT "tagid","intvalue","floatvalue","stringvalue","datevalue","t_stamp","dataintegrity"
FROM sqlt_data_1_2021_10
WHERE "t_stamp">=? and "t_stamp"<=? and ("tagid"=?)
ORDER BY "t_stamp" ASC, "tagid" ASC database={DatabaseConnectionProfileName}, request-origin=127.0.0.1,
session-user=admin, session-project=Test, session-id=11350329, queryid=81337e7a
-
TRACE log from Selects showing a SELECT statement for a running, real-time Easy Chart trending Tag History. The origin of the query can be traced using the information provided ( request-origin, session-user, session-project):
-
-
TRACE log from Selects that shows a default logger accompanying Database.FaultedConnectionRetryDaemon for testing valid database connections. A simple SELECT will also be running every 10 seconds:
SELECT 1 database={DatabaseConnectionProfileName}
-
TRACE log from Selects that shows a default logger accompanying Database.FaultedConnectionRetryDaemon for testing valid database connections. A simple SELECT will also be running every 10 seconds:
gateway.Database.Updates
- Allows you to monitor specific queries down to the exact syntax being executed against a database. It will not provide values of dynamic parameters.
-
-
TRACE log from Updates showing the full query entered from the Database Query Browser:
INSERT INTO test_table (NAME, TIMESTAMP) VALUES ('Taron','Wed Apr 24 09:11:47 PDT 2019')
-
TRACE log from Updates showing the full query entered from the Database Query Browser:
-
-
TRACE log from Updates showing the full query entered from the Database Query Browser with an illegal insert to an ID column. (Note: Again, there is no warning of bad syntax stated in the logs, but the full query is still reported):
INSERT INTO test_table (ID, NAME, TIMESTAMP) VALUES (3,'Taron','Wed Apr 24 09:11:47 PDT 2019')
-
TRACE log from Updates showing the full query entered from the Database Query Browser with an illegal insert to an ID column. (Note: Again, there is no warning of bad syntax stated in the logs, but the full query is still reported):
-
-
TRACE log from Updates showing INSERT and UPDATE to Tag History tables:
UPDATE sqlth_sce SET "end_time"=? WHERE "scid"=? and "rate"=? and "start_time"<=? and "end_time">=? database={DatabaseConnectionProfileName}
INSERT INTO sqlt_data_1_2021_10("tagid", "intvalue", "floatvalue", "stringvalue", "datevalue", "dataintegrity", "t_stamp")
VALUES(?,?,?,?,?,?,?) [Batch x1] database={DatabaseConnectionProfileName}
-
TRACE log from Updates showing INSERT and UPDATE to Tag History tables:
gateway.Database.FaultedConnectionRetryDaemon
- Monitors connection tests being made to existing databases every 10 seconds. Expect to see both an attempt to connect and a result of that test.
-
DEBUG log showing a successful connection request and response to an existing database server. {DatabaseConnectionProfileName} is denoted as the name of an existing database connection in the Ignition config:
Running test for datasource "{DatabaseConnectionProfileName}" (Current status = Valid)
Completed test for datasource "{DatabaseConnectionProfileName}" in 0 ms, status is now: Valid
-
DEBUG log showing a successful connection request and response to an existing database server. {DatabaseConnectionProfileName} is denoted as the name of an existing database connection in the Ignition config:
-
-
DEBUG log showing attempts to communicate to an existing, faulted connection. This log even typically appears before the result of Database when it returns an error:
Running test for datasource "{DatabaseConnectionProfileName}" (Current status = Faulted)
-
DEBUG log showing attempts to communicate to an existing, faulted connection. This log even typically appears before the result of Database when it returns an error:
Comments
0 comments
Article is closed for comments.