We moved this page to our Documentation Portal. You can find the latest updates here. |
Question
The UI logs have been cleaned so there are no transaction logs visible. How can I view previous log output for transactions if the UI logs have been cleaned?
Environment
All OnApp versions
Answer
There are many cases where the UI logs have been cleaned to make the UI look less cluttered and to hide transactions from end user view. While the UI won't display the logs after that, it is still possible to view the log output through the database.
If you have the Virtual Machine identifier, you can look at the transactions table with a command like this 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)
From here, you can then choose 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)
The above 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)
Then, you can again choose 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)