Logging is broken in several containers in dev setup
E.g. for the tor_weather_app_server
:
tor_weather_app_server | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/bin/flask", line 8, in <module>
tor_weather_app_server | sys.exit(main())
tor_weather_app_server | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/flask/cli.py", line 1064, in main
tor_weather_app_server | cli.main()
tor_weather_app_server | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/click/core.py", line 1078, in main
tor_weather_app_server | rv = self.invoke(ctx)
tor_weather_app_server | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/click/core.py", line 1682, in invoke
tor_weather_app_server | cmd_name, cmd, args = self.resolve_command(ctx, args)
tor_weather_app_server | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/click/core.py", line 1729, in resolve_command
tor_weather_app_server | cmd = self.get_command(ctx, cmd_name)
tor_weather_app_server | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/flask/cli.py", line 579, in get_command
tor_weather_app_server | app = info.load_app()
tor_weather_app_server | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/flask/cli.py", line 309, in load_app
tor_weather_app_server | app = locate_app(import_name, name)
tor_weather_app_server | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/flask/cli.py", line 219, in locate_app
tor_weather_app_server | __import__(module_name)
tor_weather_app_server | File "/app/tor_weather/__init__.py", line 8, in <module>
tor_weather_app_server | from tor_weather.error import APIError
tor_weather_app_server | File "/app/tor_weather/error.py", line 5, in <module>
tor_weather_app_server | from tor_weather.extensions import app_logger
tor_weather_app_server | File "/app/tor_weather/extensions.py", line 25, in <module>
tor_weather_app_server | app_logger = create_logger("app")
tor_weather_app_server | File "/app/tor_weather/utilities/logging.py", line 39, in create_logger
tor_weather_app_server | logger.addHandler(get_rotating_file_handler(name))
tor_weather_app_server | File "/app/tor_weather/utilities/logging.py", line 24, in get_rotating_file_handler
tor_weather_app_server | handler = TimedRotatingFileHandler(dirname, when="midnight")
tor_weather_app_server | File "/usr/local/lib/python3.10/logging/handlers.py", line 214, in __init__
tor_weather_app_server | BaseRotatingHandler.__init__(self, filename, 'a', encoding=encoding,
tor_weather_app_server | File "/usr/local/lib/python3.10/logging/handlers.py", line 58, in __init__
tor_weather_app_server | logging.FileHandler.__init__(self, filename, mode=mode,
tor_weather_app_server | File "/usr/local/lib/python3.10/logging/__init__.py", line 1169, in __init__
tor_weather_app_server | StreamHandler.__init__(self, self._open())
tor_weather_app_server | File "/usr/local/lib/python3.10/logging/__init__.py", line 1201, in _open
tor_weather_app_server | return open_func(self.baseFilename, self.mode,
tor_weather_app_server | FileNotFoundError: [Errno 2] No such file or directory: '/app/logs/app'
Or tor_weather_celery_worker
:
tor_weather_celery_worker | Usage: celery [OPTIONS] COMMAND [ARGS]...
tor_weather_celery_worker | Try 'celery --help' for help.
tor_weather_celery_worker |
tor_weather_celery_worker | Error: Invalid value for '-A' / '--app':
tor_weather_celery_worker | Unable to load celery application.
tor_weather_celery_worker | While trying to load the module tor_weather.celery.celery the following error occurred:
tor_weather_celery_worker | Traceback (most recent call last):
tor_weather_celery_worker | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/celery/bin/celery.py", line 58, in convert
tor_weather_celery_worker | return find_app(value)
tor_weather_celery_worker | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/celery/app/utils.py", line 383, in find_app
tor_weather_celery_worker | sym = symbol_by_name(app, imp=imp)
tor_weather_celery_worker | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/kombu/utils/imports.py", line 59, in symbol_by_name
tor_weather_celery_worker | module = imp(module_name, package=package, **kwargs)
tor_weather_celery_worker | File "/root/.cache/pypoetry/virtualenvs/tor-weather-9TtSrW0h-py3.10/lib/python3.10/site-packages/celery/utils/imports.py", line 109, in import_from_cwd
tor_weather_celery_worker | return imp(module, package=package)
tor_weather_celery_worker | File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
tor_weather_celery_worker | return _bootstrap._gcd_import(name[level:], package, level)
tor_weather_celery_worker | File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
tor_weather_celery_worker | File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
tor_weather_celery_worker | File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
tor_weather_celery_worker | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
tor_weather_celery_worker | File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
tor_weather_celery_worker | File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
tor_weather_celery_worker | File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
tor_weather_celery_worker | File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
tor_weather_celery_worker | File "<frozen importlib._bootstrap_external>", line 883, in exec_module
tor_weather_celery_worker | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
tor_weather_celery_worker | File "/app/tor_weather/__init__.py", line 8, in <module>
tor_weather_celery_worker | from tor_weather.error import APIError
tor_weather_celery_worker | File "/app/tor_weather/error.py", line 5, in <module>
tor_weather_celery_worker | from tor_weather.extensions import app_logger
tor_weather_celery_worker | File "/app/tor_weather/extensions.py", line 25, in <module>
tor_weather_celery_worker | app_logger = create_logger("app")
tor_weather_celery_worker | File "/app/tor_weather/utilities/logging.py", line 39, in create_logger
tor_weather_celery_worker | logger.addHandler(get_rotating_file_handler(name))
tor_weather_celery_worker | File "/app/tor_weather/utilities/logging.py", line 24, in get_rotating_file_handler
tor_weather_celery_worker | handler = TimedRotatingFileHandler(dirname, when="midnight")
tor_weather_celery_worker | File "/usr/local/lib/python3.10/logging/handlers.py", line 214, in __init__
tor_weather_celery_worker | BaseRotatingHandler.__init__(self, filename, 'a', encoding=encoding,
tor_weather_celery_worker | File "/usr/local/lib/python3.10/logging/handlers.py", line 58, in __init__
tor_weather_celery_worker | logging.FileHandler.__init__(self, filename, mode=mode,
tor_weather_celery_worker | File "/usr/local/lib/python3.10/logging/__init__.py", line 1169, in __init__
tor_weather_celery_worker | StreamHandler.__init__(self, self._open())
tor_weather_celery_worker | File "/usr/local/lib/python3.10/logging/__init__.py", line 1201, in _open
tor_weather_celery_worker | return open_func(self.baseFilename, self.mode,
tor_weather_celery_worker | FileNotFoundError: [Errno 2] No such file or directory: '/app/logs/app'
tor_weather_celery_worker |