I am using Ubuntu docker image to run my application. I forked it wit addition of python3 and pip3 so I do have direct access to them once I do cf ssh my-app.
I created a sample log_test.py file with following code:
import logging
from sap import cf_logging
cf_logging.init()
logger = logging.getLogger("cli.logger")
logger.info('hi')
However when I run it using python3 log_test.py, I do get the following message:
Hello,
I am using Ubuntu docker image to run my application. I forked it wit addition of python3 and pip3 so I do have direct access to them once I do cf ssh my-app.
I created a sample log_test.py file with following code:
However when I run it using python3 log_test.py, I do get the following message:
{"component_id": "a43e1b1b-504e-4f6d-924d-c7d751735606", "component_name": "my-app", "component_instance": "0", "space_id": "e36f0c53-888e-468b-a282-6bff5107b570", "space_name": "dev", "container_id": "10.32.2.11", "component_type": "application", "written_at": "2020-11-18T14:07:05.349Z", "written_ts": 1605708425349822000, "correlation_id": "-", "layer": "python", "type": "log", "logger": "cli.logger", "thread": "MainThread", "level": "INFO", "line_no": 7, "msg": "hiiii"}
But hiiii messages does not get recorded in cloud foundry portal
What needs to be done to get my data from python app into application logs area from above screenshot?