I have this simple Hello World type example in Python3 on a Docker container which is spun on using a Google Cloud Compute VM using Container Optimized OS.
Dockerfile
FROM python:3.11.0a7-bullseye
WORKDIR /application
COPY . .
CMD python3 main.py
main.py
import logging
logging.basicConfig(level=logging.INFO)
def main():
logging.info("THIS IS INFO")
logging.warning("THIS IS WARNING")
logging.error("THIS IS ERROR")
if __name__ == "__main__":
main()
Running the container on my local machine results in expected output:
INFO:root:THIS IS INFO
WARNING:root:THIS IS WARNING
ERROR:root:THIS IS ERROR
But the issue is when I start a Compute VM, the output is seen but the severity is not correct. All statements are treated as Default
.
What I've read so far: