feat: Add log_file config into skyline.yaml.sample
Add log_file config. Now log path of skyline is log_dir with log_file, no other hardcode path. Change-Id: Ieb1fd567e02110238568840fe3641770def0994d
This commit is contained in:
parent
1edaacf735
commit
fb1d6d8d4b
@ -86,9 +86,9 @@ Deployment with Sqlite
|
|||||||
|
|
||||||
.. code:: bash
|
.. code:: bash
|
||||||
|
|
||||||
rm -rf /tmp/skyline && mkdir /tmp/skyline
|
rm -rf /tmp/skyline && mkdir /tmp/skyline && mkdir /var/log/skyline
|
||||||
|
|
||||||
docker run -d --name skyline_bootstrap -e KOLLA_BOOTSTRAP="" -v /etc/skyline/skyline.yaml:/etc/skyline/skyline.yaml -v /tmp/skyline:/tmp --net=host 99cloud/skyline:latest
|
docker run -d --name skyline_bootstrap -e KOLLA_BOOTSTRAP="" -v /var/log/skyline:/var/log/skyline -v /etc/skyline/skyline.yaml:/etc/skyline/skyline.yaml -v /tmp/skyline:/tmp --net=host 99cloud/skyline:latest
|
||||||
|
|
||||||
# Check bootstrap is normal `exit 0`
|
# Check bootstrap is normal `exit 0`
|
||||||
docker logs skyline_bootstrap
|
docker logs skyline_bootstrap
|
||||||
@ -105,7 +105,7 @@ Deployment with Sqlite
|
|||||||
|
|
||||||
.. code:: bash
|
.. code:: bash
|
||||||
|
|
||||||
docker run -d --name skyline --restart=always -v /etc/skyline/skyline.yaml:/etc/skyline/skyline.yaml -v /tmp/skyline:/tmp --net=host 99cloud/skyline:latest
|
docker run -d --name skyline --restart=always -v /var/log/skyline:/var/log/skyline -v /etc/skyline/skyline.yaml:/etc/skyline/skyline.yaml -v /tmp/skyline:/tmp --net=host 99cloud/skyline:latest
|
||||||
|
|
||||||
Deployment with MariaDB
|
Deployment with MariaDB
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -124,7 +124,7 @@ function configure_skyline {
|
|||||||
# devstack will not create internal interface
|
# devstack will not create internal interface
|
||||||
# we can see more details from devstack/lib/keystone
|
# we can see more details from devstack/lib/keystone
|
||||||
_skyline_config_set $SKYLINE_CONF_FILE "interface_type: *.*" "interface_type: public"
|
_skyline_config_set $SKYLINE_CONF_FILE "interface_type: *.*" "interface_type: public"
|
||||||
_skyline_config_set $SKYLINE_CONF_FILE "log_dir: *.*" "log_dir: /var/log"
|
_skyline_config_set $SKYLINE_CONF_FILE "log_dir: *.*" "log_dir: $SKYLINE_LOG_DIR"
|
||||||
}
|
}
|
||||||
|
|
||||||
# create_skyline_accounts() - Create required service accounts
|
# create_skyline_accounts() - Create required service accounts
|
||||||
|
@ -19,6 +19,4 @@ GITDIR["skyline-console"]=$DEST/skyline-console
|
|||||||
SKYLINE_CONF_DIR=${SKYLINE_CONF_DIR:-/etc/skyline}
|
SKYLINE_CONF_DIR=${SKYLINE_CONF_DIR:-/etc/skyline}
|
||||||
SKYLINE_CONF_FILE=${SKYLINE_CONF_DIR}/skyline.yaml
|
SKYLINE_CONF_FILE=${SKYLINE_CONF_DIR}/skyline.yaml
|
||||||
SKYLINE_LOG_DIR=/var/log/skyline
|
SKYLINE_LOG_DIR=/var/log/skyline
|
||||||
SKYLINE_ERROR_LOG_FILE=${SKYLINE_LOG_DIR}/error.log
|
|
||||||
SKYLINE_ACCESS_LOG_FILE=${SKYLINE_LOG_DIR}/access.log
|
|
||||||
SKYLINE_RUN_DIR=/var/lib/skyline
|
SKYLINE_RUN_DIR=/var/lib/skyline
|
||||||
|
@ -16,6 +16,7 @@ file ``skyline.yaml.sample`` in ``etc`` directory.
|
|||||||
database_url: sqlite:////tmp/skyline.db
|
database_url: sqlite:////tmp/skyline.db
|
||||||
debug: false
|
debug: false
|
||||||
log_dir: ./log
|
log_dir: ./log
|
||||||
|
log_file: skyline.log
|
||||||
prometheus_basic_auth_password: ''
|
prometheus_basic_auth_password: ''
|
||||||
prometheus_basic_auth_user: ''
|
prometheus_basic_auth_user: ''
|
||||||
prometheus_enable_basic_auth: false
|
prometheus_enable_basic_auth: false
|
||||||
|
@ -115,7 +115,7 @@ We will install the Skyline APIServer service from docker image.
|
|||||||
default:
|
default:
|
||||||
database_url: mysql://skyline:SKYLINE_DBPASS@DB_SERVER:3306/skyline
|
database_url: mysql://skyline:SKYLINE_DBPASS@DB_SERVER:3306/skyline
|
||||||
debug: true
|
debug: true
|
||||||
log_dir: /var/log
|
log_dir: /var/log/skyline
|
||||||
openstack:
|
openstack:
|
||||||
keystone_url: http://KEYSTONE_SERVER:5000/v3/
|
keystone_url: http://KEYSTONE_SERVER:5000/v3/
|
||||||
system_user_password: SKYLINE_SERVICE_PASSWORD
|
system_user_password: SKYLINE_SERVICE_PASSWORD
|
||||||
|
@ -137,7 +137,7 @@ We will install the Skyline APIServer service from source code.
|
|||||||
default:
|
default:
|
||||||
database_url: mysql://skyline:SKYLINE_DBPASS@DB_SERVER:3306/skyline
|
database_url: mysql://skyline:SKYLINE_DBPASS@DB_SERVER:3306/skyline
|
||||||
debug: true
|
debug: true
|
||||||
log_dir: /var/log
|
log_dir: /var/log/skyline
|
||||||
openstack:
|
openstack:
|
||||||
keystone_url: http://KEYSTONE_SERVER:5000/v3/
|
keystone_url: http://KEYSTONE_SERVER:5000/v3/
|
||||||
system_user_password: SKYLINE_SERVICE_PASSWORD
|
system_user_password: SKYLINE_SERVICE_PASSWORD
|
||||||
|
@ -44,12 +44,12 @@ logconfig_dict = {
|
|||||||
"error_file": {
|
"error_file": {
|
||||||
"class": "logging.handlers.RotatingFileHandler",
|
"class": "logging.handlers.RotatingFileHandler",
|
||||||
"formatter": "generic",
|
"formatter": "generic",
|
||||||
"filename": "/var/log/skyline/error.log",
|
"filename": "/var/log/skyline/skyline-error.log",
|
||||||
},
|
},
|
||||||
"access_file": {
|
"access_file": {
|
||||||
"class": "logging.handlers.RotatingFileHandler",
|
"class": "logging.handlers.RotatingFileHandler",
|
||||||
"formatter": "generic",
|
"formatter": "generic",
|
||||||
"filename": "/var/log/skyline/access.log",
|
"filename": "/var/log/skyline/skyline-access.log",
|
||||||
},
|
},
|
||||||
"console": {
|
"console": {
|
||||||
"class": "logging.StreamHandler",
|
"class": "logging.StreamHandler",
|
||||||
|
@ -5,6 +5,7 @@ default:
|
|||||||
database_url: sqlite:////tmp/skyline.db
|
database_url: sqlite:////tmp/skyline.db
|
||||||
debug: false
|
debug: false
|
||||||
log_dir: ./log
|
log_dir: ./log
|
||||||
|
log_file: skyline.log
|
||||||
prometheus_basic_auth_password: ''
|
prometheus_basic_auth_password: ''
|
||||||
prometheus_basic_auth_user: ''
|
prometheus_basic_auth_user: ''
|
||||||
prometheus_enable_basic_auth: false
|
prometheus_enable_basic_auth: false
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Add ``log_file`` config into skyline.yaml.sample. Now the log
|
||||||
|
path of skyline is log_dir with log_file, no other hardcode path.
|
@ -34,6 +34,13 @@ log_dir = Opt(
|
|||||||
default="./log",
|
default="./log",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
log_file = Opt(
|
||||||
|
name="log_file",
|
||||||
|
description="Log file",
|
||||||
|
schema=StrictStr,
|
||||||
|
default="skyline.log",
|
||||||
|
)
|
||||||
|
|
||||||
secret_key = Opt(
|
secret_key = Opt(
|
||||||
name="secret_key",
|
name="secret_key",
|
||||||
description="Secret key",
|
description="Secret key",
|
||||||
@ -115,6 +122,7 @@ GROUP_NAME = __name__.split(".")[-1]
|
|||||||
ALL_OPTS = (
|
ALL_OPTS = (
|
||||||
debug,
|
debug,
|
||||||
log_dir,
|
log_dir,
|
||||||
|
log_file,
|
||||||
secret_key,
|
secret_key,
|
||||||
access_token_expire,
|
access_token_expire,
|
||||||
access_token_renew,
|
access_token_renew,
|
||||||
|
@ -32,7 +32,7 @@ PROJECT_NAME = "Skyline API"
|
|||||||
async def on_startup() -> None:
|
async def on_startup() -> None:
|
||||||
configure("skyline")
|
configure("skyline")
|
||||||
log_setup(
|
log_setup(
|
||||||
Path(CONF.default.log_dir).joinpath("skyline", "skyline-apiserver.log"),
|
Path(CONF.default.log_dir).joinpath(CONF.default.log_file),
|
||||||
debug=CONF.default.debug,
|
debug=CONF.default.debug,
|
||||||
)
|
)
|
||||||
policies_setup()
|
policies_setup()
|
||||||
|
@ -44,8 +44,8 @@ http {
|
|||||||
'"$upstream_response_time" "$request" '
|
'"$upstream_response_time" "$request" '
|
||||||
'$status $body_bytes_sent "$http_referer" '
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
access_log {{ log_dir | default('/var/log') }}/skyline/nginx_access.log main;
|
access_log {{ log_dir | default('/var/log/skyline') }}/skyline-nginx-access.log main;
|
||||||
error_log {{ log_dir | default('/var/log') }}/skyline/nginx_error.log;
|
error_log {{ log_dir | default('/var/log/skyline') }}/skyline-nginx-error.log;
|
||||||
|
|
||||||
##
|
##
|
||||||
# Gzip Settings
|
# Gzip Settings
|
||||||
|
Loading…
Reference in New Issue
Block a user