Commit 4b64e213 authored by Vaibhavi Kamani's avatar Vaibhavi Kamani
Browse files

Addressing MR comments

parent 239d16b6
Pipeline #93368 failed
......@@ -324,6 +324,18 @@ IMAGE_TAG="os-wellbore-ddms:dev"
docker build -t=$IMAGE_TAG --rm . -f ./build/dockerfile --build-arg PIP_WHEEL_DIR=python-packages
```
Note: On running above build image command if you get `"Error response from daemon: Cannot locate specified Dockerfile: build/dockerfile"`, then
it might be due because `Your docker can not locate the docker file which is case sensitive, it perhaps because its not written correctly (some bad examples :DockerFile , dockerfile, Dockerfile.txt , .DockerFile etc...).
another option might related to the file location not in the correct path.`
Solution for this is to rename the Dockerfile (The correct spell is Dockerfile) an d make sure you're running it in the project location.
Use the command below:
```bash
# Build Image
docker build -t=$IMAGE_TAG --rm . -f ./build/Dockerfile --build-arg PIP_WHEEL_DIR=python-packages
```
#### Run Image
1. Run the image
......
......@@ -119,30 +119,22 @@ def create_azure_logger(service_name):
# AzurelogHandler for logging to azure appinsight
key = Config.get('az_ai_instrumentation_key')
if type(key) is not None:
if key:
logger_level = Config.get('az_logger_level')
az_handler = AzureLogHandler(connection_string=f'InstrumentationKey={key}')
az_handler.setLevel(logging.getLevelName(logger_level))
az_handler.add_telemetry_processor(rename_cloud_role_func(service_name))
# Acquire the logger for azure library
az_logger = logging.getLogger('azure')
az_logger.setLevel(logging.INFO)
az_logger.addHandler(stdout_handler)
__getLogger(logger_name='azure', log_level=logging.INFO, stdout_handler=stdout_handler)
# Acquire the logger for osdu-core-lib-python-azure
osdu_core_lib_logger = logging.getLogger('osdu_az')
osdu_core_lib_logger.setLevel(logging.INFO)
osdu_core_lib_logger.addHandler(stdout_handler)
if type(key) is not None:
osdu_core_lib_logger.addHandler(az_handler)
__getLogger(logger_name='osdu_az', log_level=logging.INFO, stdout_handler=stdout_handler,
az_handler=az_handler)
# Acquire the logger for wdms
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logger.addHandler(stdout_handler)
if type(key) is not None:
logger.addHandler(az_handler)
__getLogger(logger_name=__name__, log_level=logging.INFO, stdout_handler=stdout_handler,
az_handler=az_handler)
# return wdms logger with Context adapter
return AzureContextLoggerAdapter(logger, extra=dict())
......@@ -187,3 +179,11 @@ def create_gcp_logger(service_name):
std_ddms_app.propagate = False
return my_logger
def __getLogger(logger_name, log_level, stdout_handler, az_handler=None):
logger = logging.getLogger(logger_name)
logger.setLevel(log_level)
logger.addHandler(stdout_handler)
if az_handler:
logger.addHandler(az_handler)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment