Collecting Logs
On the log service containers, a script is available to compress logs collected and put at output path mentioned below. Container and access logs can be collected between two dates.
OUTPUT PATH:
/mnt/data
For example, filenames for all the logs would be
all-logs_2018_11_20_14_32.tar.gz or
access-logs_2018_11_20_14_32.tar.gz or
tm-log-log-set-0-0-logs_2018_11_20_14_32.tar.gz.
Options | Possible Values | Default |
---|---|---|
-c | ( --container-type) | ALL or any container name (e.g. tml-log,tml-sql,tml-nosql,tml-tm,tml-cache,tml-cm) | ALL |
-n | (--container-hostname) | ALL or any hostname for the selected container-type. It won't allow to have only hostname passed without selecting container-type. | ALL |
-a | (--access-log) | No need to pass any value. If this param is selected then access logs would also be collected in separate file. | NA |
-t | (--log-type) | It can be ALL, METRIC, CONTAINER, VERBOSE | ALL |
-s | (--start-date) | It represents the start date of the log collection. Format is yyyy_mm_dd | NA |
-e | (--end-date) | It represents end date till what logs need to be collected. Format is yyyy_mm_dd | NA |
-h | (--help) | NA. Would print usage details for this utility | NA |
Scenario 3: To get logs from one container type's one host
- Connect to log container.
- Run the following command:
/opt/mashery/containeragent/bin/getlogs.sh --container-type tml-sql --container-hostname mysql-set-0-1
- Download the tar file from the /mnt/data folder, which will have a name similar to tml-sql-mysql-set-0-1-logs_2018_11_20_14_32.tar.gz".
- User can also collect logs between two dates by using start-date and end-date option.
/opt/mashery/containeragent/bin/getlogs.sh --container-type tml-sql --container-hostname mysql-set-0-1 --start-date 2019_08_13 --end-date 2019_08_14
Scenario 4: To get metric logs only
- Connect to log container.
- Run the following command:
/opt/mashery/containeragent/bin/getlogs.sh --log-type METRIC
- Download the tar file from the /mnt/data folder, which will have a name similar to All-logs_2019_08_14_06_56.tar.gz.
- User can also collect logs between two dates by using start-date and end-date option.
/opt/mashery/containeragent/bin/getlogs.sh --log-type METRIC
Scenario 5: To get access logs
- Connect to log container.
- Run the following command:
/opt/mashery/containeragent/bin/getlogs.sh --access-log
- Download the tar file from the /mnt/data folder, which will have a name similar to access-logs_2018_11_20_14_32.tar.gz.
- User can also collect logs between two dates by using start-date and end-date option.
/opt/mashery/containeragent/bin/getlogs.sh --container-type tml-sql --start-date 2019_08_13 --end-date 2019_08_14
Scenario 6: Wrong selection
You cannot select container-type as ALL and specific hostname.
Example 1:
/opt/mashery/containeragent/bin/getlogs.sh --container-hostname mysql-set-0-1 ERROR: Please provide proper input. --container-hostname|-n can be given with --container-type|-cExample 2:
/opt/mashery/containeragent/bin/getlogs.sh --container-type ALL --container-hostname mysql-set-0-1 ERROR: Please provide proper input. --container-hostname|-n can be given with --container-type|-c
You cannot collect both access logs and other logs together.
Example:
/opt/mashery/containeragent/bin/getlogs.sh -a --container-type tml-sql ERROR: Access logs and other logs can not be collected at the same time. Only one type of logs can be collected
Copyright © 2022. Cloud Software Group, Inc. All Rights Reserved.