Task #2559
Add logging to the Docker container
Start date:
12/31/2019
Due date:
% Done:
100%
Associated revisions
Logging to file and to docker
Reference #2559
History
#1 Updated by Luke Murphey almost 5 years ago
- Status changed from New to In Progress
I tried the following:
RUN ln -sf /dev/stdout /usr/src/app/var/log/app.log
This generates an error though:
--- Logging error --- Traceback (most recent call last): File "/usr/local/lib/python3.7/logging/handlers.py", line 69, in emit if self.shouldRollover(record): File "/usr/local/lib/python3.7/logging/handlers.py", line 186, in shouldRollover self.stream.seek(0, 2) #due to non-posix-compliant Windows feature io.UnsupportedOperation: underlying stream is not seekable Call stack: File "/usr/local/lib/python3.7/threading.py", line 890, in _bootstrap self._bootstrap_inner() File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/usr/local/lib/python3.7/site-packages/wsgiserver.py", line 1572, in run conn.communicate() File "/usr/local/lib/python3.7/site-packages/wsgiserver.py", line 1394, in communicate req.respond() File "/usr/local/lib/python3.7/site-packages/wsgiserver.py", line 848, in respond self.server.gateway(self).respond() File "/usr/local/lib/python3.7/site-packages/wsgiserver.py", line 2336, in respond response = self.req.server.wsgi_app(self.env, self.start_response) File "/usr/local/lib/python3.7/site-packages/django/core/handlers/wsgi.py", line 157, in __call__ response = self.get_response(request) File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 124, in get_response response = self._middleware_chain(request) File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py", line 41, in inner response = get_response(request) File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response response = self._get_response(request) File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 185, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/src/app/reader/shortcuts/__init__.py", line 427, in return_cached_page_if_ajax logger.debug("Cache miss for key=%s", key)
#3 Updated by Luke Murphey almost 5 years ago
- Status changed from In Progress to New
#4 Updated by Luke Murphey almost 5 years ago
I setup logging to standard out. This works ok but the severity isn't included.
#5 Updated by Luke Murphey almost 5 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 50
#6 Updated by Luke Murphey almost 5 years ago
I don't like the way logging works with this. Exceptions don't get parsed out well.
#7 Updated by Luke Murphey almost 5 years ago
- Status changed from In Progress to Closed
- % Done changed from 50 to 100