Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce logger #126

Merged
merged 4 commits into from
Nov 23, 2021
Merged

Introduce logger #126

merged 4 commits into from
Nov 23, 2021

Conversation

mmacata
Copy link
Collaborator

@mmacata mmacata commented Nov 19, 2021

This PR introduces a logger. By default it prints logs to STDOUT in JSON format. It is not configurable yet but if this is needed it can be done in a separate PR.

One example log is integrated in collections.py. The line log.warning("Couldn't get STAC collections from actinia") will look like the following in the STDOUT log output:

{"time": "2021-11-19T16:50:00.811279Z", "level": "WARNING", "component": "openeo-grass-gis-driver", "module": "collections", "message": "Couldn't get STAC collections from actinia", "pathname": "/src/openeo_grass_gis_driver/src/openeo_grass_gis_driver/collections.py", "lineno": 97, "processName": "MainProcess", "threadName": "Thread-10"}

Depending on deployment, simple print statements are not visible in STDOUT/collected for docker logs. These print statements were adjusted in this PR as well.
This also helps for integration with logging tools like e.g. Kibana when deployed in a cloud environment.

Copy link
Collaborator

@metzm metzm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@mmacata mmacata merged commit 6a8ec2c into Open-EO:master Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants