mirror of
https://github.com/Novartis/cellxgene-gateway.git
synced 2026-10-10 07:10:56 +08:00
#68 add param to set log level
This commit is contained in:
@@ -76,6 +76,7 @@ Optional environment variables:
|
|||||||
* `GATEWAY_EXTRA_SCRIPTS` - JSON array of script paths, will be embedded into each page and forwarded with `--scripts` to cellxgene server
|
* `GATEWAY_EXTRA_SCRIPTS` - JSON array of script paths, will be embedded into each page and forwarded with `--scripts` to cellxgene server
|
||||||
* `GATEWAY_ENABLE_ANNOTATIONS` - Set to `true` or to `1` to enable cellxgene annotations.
|
* `GATEWAY_ENABLE_ANNOTATIONS` - Set to `true` or to `1` to enable cellxgene annotations.
|
||||||
* `GATEWAY_ENABLE_BACKED_MODE` - Set to `true` or to `1` to load AnnData in file-backed mode. This saves memory and speeds up launch time but may reduce overall performance.
|
* `GATEWAY_ENABLE_BACKED_MODE` - Set to `true` or to `1` to load AnnData in file-backed mode. This saves memory and speeds up launch time but may reduce overall performance.
|
||||||
|
* `GATEWAY_LOG_LEVEL` - default is `INFO`. set to `DEBUG` to increase logging and to `WARNING` to decrease logging.
|
||||||
* `S3_ENABLE_LISTINGS_CACHE` - Set to `true` or to `1` to cache listings of S3 folders for performance. If the cache becomes stale, set `filecrawl.html?refresh=true` query parameter to refresh the cache.
|
* `S3_ENABLE_LISTINGS_CACHE` - Set to `true` or to `1` to cache listings of S3 folders for performance. If the cache becomes stale, set `filecrawl.html?refresh=true` query parameter to refresh the cache.
|
||||||
|
|
||||||
If any of the following optional variables are set, [ProxyFix](https://werkzeug.palletsprojects.com/en/1.0.x/middleware/proxy_fix/) will be used.
|
If any of the following optional variables are set, [ProxyFix](https://werkzeug.palletsprojects.com/en/1.0.x/middleware/proxy_fix/) will be used.
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import socket
|
|
||||||
|
|
||||||
cellxgene_location = os.environ.get("CELLXGENE_LOCATION")
|
cellxgene_location = os.environ.get("CELLXGENE_LOCATION")
|
||||||
cellxgene_data = os.environ.get("CELLXGENE_DATA", "")
|
cellxgene_data = os.environ.get("CELLXGENE_DATA", "")
|
||||||
@@ -33,6 +32,7 @@ enable_backed_mode = os.environ.get("GATEWAY_ENABLE_BACKED_MODE", "").lower() in
|
|||||||
"true",
|
"true",
|
||||||
"1",
|
"1",
|
||||||
]
|
]
|
||||||
|
log_level = logging.getLevelName(os.environ.get("GATEWAY_LOG_LEVEL", "INFO"))
|
||||||
|
|
||||||
env_vars = {
|
env_vars = {
|
||||||
"CELLXGENE_LOCATION": cellxgene_location,
|
"CELLXGENE_LOCATION": cellxgene_location,
|
||||||
@@ -53,6 +53,7 @@ optional_env_vars = {
|
|||||||
"GATEWAY_TTL": ttl,
|
"GATEWAY_TTL": ttl,
|
||||||
"GATEWAY_ENABLE_ANNOTATIONS": enable_annotations,
|
"GATEWAY_ENABLE_ANNOTATIONS": enable_annotations,
|
||||||
"GATEWAY_ENABLE_BACKED_MODE": enable_backed_mode,
|
"GATEWAY_ENABLE_BACKED_MODE": enable_backed_mode,
|
||||||
|
"GATEWAY_LOG_LEVEL": log_level,
|
||||||
"CELLXGENE_ARGS": cellxgene_args,
|
"CELLXGENE_ARGS": cellxgene_args,
|
||||||
"CELLXGENE_DATA": cellxgene_data,
|
"CELLXGENE_DATA": cellxgene_data,
|
||||||
"PROXY_FIX_FOR": proxy_fix_for,
|
"PROXY_FIX_FOR": proxy_fix_for,
|
||||||
|
|||||||
@@ -299,7 +299,7 @@ def launch():
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=logging.INFO,
|
level=env.log_level,
|
||||||
format="%(asctime)s:%(name)s:%(levelname)s:%(message)s",
|
format="%(asctime)s:%(name)s:%(levelname)s:%(message)s",
|
||||||
)
|
)
|
||||||
cellxgene_data = os.environ.get("CELLXGENE_DATA", None)
|
cellxgene_data = os.environ.get("CELLXGENE_DATA", None)
|
||||||
|
|||||||
Reference in New Issue
Block a user