Managing application logs

ioxclient provides CLIs to manage application log files.

Getting application log information

$ ./ioxclient  application logs info py
Currently active profile :  default
Command Name: application-logs-info

Log file information for :  py
    Size_bytes : 1.275576e+06
    Download_link : /admin/download/logs?filename=py-stdout.log
    Timestamp : Fri May 13 22:42:29 2016
    Filename : stdout.log

    Download_link : /admin/download/logs?filename=py-container_log_py.log
    Timestamp : Fri May 13 16:38:11 2016
    Filename : container_log_py.log
    Size_bytes : 17064

Downloading a log file

Download a log file by its name. If name is not provided, it is prompted for.

$ ./ioxclient  application logs download
NAME:
   download - Download a log file

USAGE:
   command download <application_id>[file_path]

$ ./ioxclient  application logs download py stdout.log
Currently active profile :  default
Command Name: application-logs-download
Retrieved log file successfully. Content stored at py-c3Rkb3V0LmxvZw==

Viewing last few lines of a particular log file

You can view last n lines of a log file by providing its name and the number of lines to be tailed. If the parameters are not part of the command, they are prompted for.

$ ./ioxclient  application logs tail
NAME:
   tail - Get last n lines from a specific log file

USAGE:
   command tail <application_id>[file_path][n_lines]


 $ ./ioxclient  application logs tail  py stdout.log 3
 Currently active profile :  default
 Command Name: application-logs-tail
 App/Service : py, Logfile : stdout.log, viewing last 3 lines
 1 packets transmitted, 1 packets received, 0% packet loss
 round-trip min/avg/max = 42.133/42.133/42.133 ms

Deleting a log file

Delete a log file by its name. If not provided, it is prompted for.

$ ./ioxclient  application logs delete
NAME:
   delete - Delete a log file

USAGE:
   command delete <application_id>[file_path]

$ ./ioxclient  application logs delete py stdout.log
Currently active profile :  default
Command Name: application-logs-delete
Log file stdout.log successfully deleted

Purge all application log files

$ ./ioxclient  app logs purge py
Currently active profile :  default
Command Name: application-logs-purge
All application log files are successfully purged

Managing application core files

Applications may coredump generating core files. ioxclient provides CLIs to manage these core files.

List application core files

$ ioxclient app cores list
NAME:
   list - List core files

USAGE:
   command list <app_id>


$ ioxclient app cores list py
Currently active profile :  local
Command Name: application-cores-list
Core file list:
------------------------
1. core.ping.162.1465195133 (413696.000000 bytes)

Download core files

$ ioxclient app cores download
NAME:
   download - Download a core file

USAGE:
   command download <app_id>[file_path]

$ ioxclient app cores download py core.ping.162.1465195133
Currently active profile :  local
Command Name: application-cores-download
Downloading file core.ping.162.1465195133
Read bytes :  413696
App corefile successfully downloaded at core.ping.162.1465195133

Download app's datamount contents

An app will be provisioned with a data mount disk where the app typically stores its data that needs to be persisted. You can download the contents of this disk as a compressed tar ball.

$ ./ioxclient  application datamount download py
Currently active profile :  local
Command Name: application-datamount-download
Read bytes :  2697
Datamount Content for py is downloaded at py-datamount.tar.gz
$ tar tzvf py-datamount.tar.gz
drwxr-xr-x root/root         0 2016-05-13 16:37 py/
-rw-r--r-- root/root       453 2016-05-13 16:37 py/.env
drwx------ root/root         0 2016-05-13 16:37 py/lost+found/
drwxr-xr-x root/root         0 2016-05-13 22:18 py/appdata/
-rw------- root/root      3714 2016-05-13 21:59 py/appdata/12network_config.yaml
drwxr-xr-x root/root         0 2016-05-13 22:55 py/logs/
-rw-r--r-- root/root        84 2016-05-13 22:55 py/logs/watchDog.log
-rw-r--r-- root/root      1923 2016-05-13 22:55 py/logs/stdout.log
-rw-r--r-- root/root        18 2016-05-13 16:37 py/package_config.ini

Managing contents of "appdata" directory

IOx CAF provides file management to upload, download adhoc data files. These files are typically stored in appdata directory in the persistent storage.

$ ./ioxclient app appdata
NAME:
   ioxclient application appdata - Manage files in the appdata directory under datamount

USAGE:
   ioxclient application appdata command [command options] [arguments...]

COMMANDS:
   view, vi		View the files/directories under appdata. If a file is chosen, it will be downloaded
   upload, upload	Upload a new file to a target path
   delete, del		Delete a file/directory under appdata
   help, h		Shows a list of commands or help for one command

OPTIONS:
   --help, -h			show help
   --generate-bash-completion

Upload adhoc data files

$ ./ioxclient app appdata upload
NAME:
   upload - Upload a new file to a target path

USAGE:
   command upload <application_id><input_file><target_path>

$ ./ioxclient app appdata upload py test_resources/app.tar.gz 1/2/app.tar.gz
Currently active profile :  local
Command Name: application-appdata-upload
Upload Successful. File is available at :  https://127.0.0.1:8443/iox/api/v2/hosting/apps/py/appdata/1/2/app.tar.gz
https://127.0.0.1:8443/iox/api/v2/hosting/apps/py/appdata/1/2/app.tar.gz

View / Download adhoc data files

$ ./ioxclient app appdata view
NAME:
   view - View the files/directories under appdata. If a file is chosen, it will be downloaded

USAGE:
   command view <application_id>[file_path]

$ ./ioxclient app appdata view py 1/2
Currently active profile :  local
Command Name: application-appdata-view
Directory Listing for path: 1/2
                         Name	 Type	  Size
-----------------------------------------------------------
                   app.tar.gz	 file	4958.000000

$ ./ioxclient app appdata view py 1/2/app.tar.gz
Currently active profile :  local
Command Name: application-appdata-view
Downloading file 1/2/app.tar.gz
Read bytes :  4958
File 1/2/app.tar.gz is downloaded at app.tar.gz

Delete adhoc data files/directories

$ ./ioxclient app appdata delete
NAME:
   delete - Delete a file/directory under appdata

USAGE:
   command delete <application_id><file_path>


$ ./ioxclient app appdata delete py 1
Currently active profile :  local
Command Name: application-appdata-delete
File or Directory 1 successfully deleted!