Viewing Transaction Log Details on Database
Question
The UI logs have been cleaned and there are no transaction logs visible. How can I view the previous log output for the transactions if the UI logs have been cleaned?
Environment
All OnApp versions
Answer
The UI logs are cleaned to make the UI look less cluttered and to hide transactions from the end user's view. If the UI does not display the old logs, it is still possible to view the log output through the database:
If you have a virtual server identifier, use the following command to choose the log output you want to view:
mysql> select id, action, status, created_at, identifier from transactions where identifier='tbhgfglxilpehn'; +-----+----------------------------+----------+---------------------+----------------+ | id | action | status | created_at | identifier | +-----+----------------------------+----------+---------------------+----------------+ | 197 | configure_operating_system | complete | 2015-02-23 18:01:38 | tbhgfglxilpehn | | 198 | startup_virtual_machine | complete | 2015-02-23 18:01:38 | tbhgfglxilpehn | | 199 | run_recipe_on_vm | failed | 2015-02-23 18:01:38 | tbhgfglxilpehn | +-----+----------------------------+----------+---------------------+----------------+ 3 rows in set (0.00 sec)
CODESelect a specific transaction to view the output:
mysql> select log_output from transactions where id=199\G *************************** 1. row *************************** log_output: [2015-02-23 18:06:00 UTC] Waiting for VS to boot... [2015-02-23 18:06:00 UTC] VS is booted. [2015-02-23 18:06:00 UTC] Waiting for VM to respond on port 22... Fatal: VM network is down for 3600 Executing Rollback... 1 row in set (0.00 sec)
CODEThe above two commands can also be used if you have a disk identifier and need to look for the disk-related task:
mysql> select id, action, status, created_at, identifier from transactions where identifier='g14vm6e7wcg07k'; +-----+--------------+----------+---------------------+----------------+ | id | action | status | created_at | identifier | +-----+--------------+----------+---------------------+----------------+ | 194 | build_disk | complete | 2015-02-23 18:01:38 | g14vm6e7wcg07k | | 196 | provisioning | complete | 2015-02-23 18:01:38 | g14vm6e7wcg07k | +-----+--------------+----------+---------------------+----------------+ 2 rows in set (0.00 sec)
CODEChoose again a specific transaction to view the output.
There are other ways to filter the output, such as looking for only completed or failed transactions:
mysql> select id, action, status, created_at, identifier from transactions where status='failed'; +-----+-------------------------+--------+---------------------+----------------+ | id | action | status | created_at | identifier | +-----+-------------------------+--------+---------------------+----------------+ | 2 | create_hypervisor | failed | 2014-08-08 19:45:36 | hwy5hqseskdap3 | | 54 | destroy_virtual_machine | failed | 2014-08-12 18:24:29 | ju1lulver2ta9r | ... | 233 | take_incremental_backup | failed | 2015-04-06 15:06:28 | qug61mtcvhwlzm | | 234 | take_incremental_backup | failed | 2015-04-07 15:06:26 | iyi6rra39f56jh | +-----+-------------------------+--------+---------------------+----------------+ 49 rows in set (0.00 sec)
CODE