Every time record log in file
The --log-file option is effective to record log of the operation,
but is not effective for an investigation because the gathered information is insufficient.
Therefore, this option is not so useful for troubleshooting.
Implementing the following in this BP.
1. Recording the operation history to log-file that specified by configuration-
Therefore, saving the log is to simple because every account can set a log-file.
2. The recorded information includes following;
if log level is "info" set, following items are logged;
cloud name
user name
project name
CLI start time (logging start time)
CLI end time
CLI argments
CLI return value
and, more info messages.
if log level is "debug" set, following items are logged;
cloud name
user name
project name
CLI start time (logging start time)
CLI end time
CLI argments
CLI return value
API request header/body
API response header/body
and, more debug messages.
if log level is not set, or other value set, that set warning level(default).
Recording the user operation, it can identify the change of the resource and it becomes useful information for troubleshooting.
For more details, refer to the following;
Following is a sample config file.
cloud.yaml
-----------
clouds:
devstack:
auth:
auth_url: http://
username: admin
password: password
region_name: RegionOne
cli_logging: # [1]
logging: TRUE # [2]
file: /home/stack/
log_level: info # [4]
-----------
[1] When it is not set, or other values are set, the logging disable.
[2] When it is not set, or set false, or other values are set, the logging disable.
[3] Set full-path of CLI logging file.
[4] Set one from following;
info, debug
if log level is not set, or other value set, that set warning level(default).
Following is a sample executed CLI.
$ cat clouds.yaml
clouds:
devstack:
auth:
auth_url: http://
username: admin
password: password
region_name: RegionOne
cli_logging:
logging: TRUE
file: /home/stack/
log_level: info
$
$ openstack --os-cloud devstack network list
+----
| ID | Name | Subnets |
+----
| 6bf9ebf0-
| 85fadf8e-
| b8e24f8e-
| d927ca95-
| f427692e-
+----
$
$ cat /home/stack/
2015-05-28 19:45:38.906 14826 INFO openstackclient
2015-05-28 19:45:38.979 14826 INFO openstackclient
2015-05-28 19:45:38.980 14826 INFO openstackclient
2015-05-28 19:45:39.335 14826 INFO openstackclient
$
The log format referred to 'logging_
oslo_
-----
log_opts = [
cfg.
-----
Blueprint information
- Status:
- Complete
- Approver:
- Steve Martinelli
- Priority:
- Medium
- Drafter:
- Daisuke Fujita
- Direction:
- Approved
- Assignee:
- Daisuke Fujita
- Definition:
- New
- Series goal:
- None
- Implementation:
- Implemented
- Milestone target:
- None
- Started by
- Steve Martinelli
- Completed by
- Steve Martinelli
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
Set up every time record log in file