I've just started to use Docker.
I'm working on a project coded by another developer. In the project Docker container, I have three micro-services (aggregatore, classificatore, testmicro), each using python module logging
for debugging purposes.
My issue is that I can't figure out where I can view the logging
output.
docker-compose.yml
version: '2.1'
services:
files:
image: busybox
volumes:
[..]
grafana:
[..]
prometheus:
[..]
aggregatore:
[..]
classificatore:
build: classificatore/.
volumes:
- [..]
volumes_from:
- files
ports:
- [..]
command: ["python", "/src/main.py"]
depends_on:
rabbit:
condition: service_healthy
testmicro:
[..]
rabbit:
[..]
I the terminal, I run
$docker-compose up -d
this launches all the microservices.
Let's focus on classificatore service.
classificatore/Dockerfile
FROM python:3
RUN mkdir /src
ADD requirements.txt /src/.
WORKDIR /src
RUN pip install -r requirements.txt
ADD . /src/.
RUN mkdir -p /tmp/reqdoc
CMD ["python", "main.py"]
classificatore/main.py
import logging
logging.basicConfig(format='%(asctime)s %(message)s', level=logging.DEBUG)
logging.getLogger('pika').setLevel(logging.WARNING)
log = logging.getLogger()
[..]
app = Flask( __name__ , template_folder='./web')
@app.route("/")
def index(message=None):
log.info("classificatore index!! ")
[..]
return render_template('index.html', files1=files1, files2=files2, message=message)
In the code above, where does the output text "classificatore index
" go?
Thank you for any support you can provide.