{"id":1564,"date":"2022-09-09T12:49:46","date_gmt":"2022-09-09T10:49:46","guid":{"rendered":"https:\/\/hobbykeller.spdns.de\/?p=1564"},"modified":"2022-09-09T12:49:46","modified_gmt":"2022-09-09T10:49:46","slug":"logging-in-mayan-edms","status":"publish","type":"post","link":"https:\/\/hobbykeller.spdns.de\/?p=1564","title":{"rendered":"Logging in Mayan EDMS"},"content":{"rendered":"\n<p>Whenever I stumbled around excerpts from error logs on the <a href=\"https:\/\/forum.mayan-edms.com\/viewtopic.php?p=9997&amp;hilit=error+log#p9997\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"broken_link\">Mayan EDMS user forum<\/a>, I asked myself, where and how to access these log files on my system. People happily included excerpts from their logs, but almost never gave any hint where to find these logs in a Mayan installation.<\/p>\n\n\n\n<p>After some searching, here&#8217;s what I found out: There are (at least) 3 error logs. For debugging Mayan, the most important one is the <code>\/opt\/mayan-edms\/media\/error.log<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">tl;dnr<\/h2>\n\n\n\n<p>In order to have debugging activated&#8230;<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Log in as administrator into the Mayan GUI<\/li><li>Go to <code>System<\/code> \/ <code>Setup<\/code> \/ <code>Settings<\/code><\/li><li>In the List click on the Settings button of the Logging section<\/li><li>Change the <code>LOGGING_HANDLERS<\/code> entry from <code>- console<\/code> to <code>- logfile<\/code> (not sure what the minus is good for)<\/li><li> The <code>LOGGING_LEVEL<\/code> entry is normally set to <code>ERROR<\/code>. Possible values with increasing granularity are <code>ERROR<\/code>, <code>WARN<\/code>, <code>INFO<\/code> and <code>DEBUG<\/code>.<\/li><li>Reboot your Mayan instance to make sure that the amended settings have been reloaded.<\/li><\/ol>\n\n\n\n<p>Debug output should now be directed to <code>\/opt\/mayan-edms\/media\/error.log<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Less useful log files<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Admin GUI of Mayan<\/h3>\n\n\n\n<p>The admin GUI of Mayan features a Global error log under the System \/ Tools section. Still one should not expect too much from this global error log. In the default setting, the only thing included is usually an empty section.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2022\/06\/global_error_log.png\"><img loading=\"lazy\" decoding=\"async\" width=\"914\" height=\"554\" src=\"https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2022\/06\/global_error_log.png\" alt=\"\" class=\"wp-image-1565\" srcset=\"https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2022\/06\/global_error_log.png 914w, https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2022\/06\/global_error_log-300x182.png 300w, https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2022\/06\/global_error_log-768x466.png 768w\" sizes=\"auto, (max-width: 914px) 100vw, 914px\" \/><\/a><figcaption class=\"wp-element-caption\">The Global error log from Mayan&#8217;s Tools section<\/figcaption><\/figure>\n\n\n\n<p>Not sure if this Global error log takes its entries from the <code>\/opt\/mayan-edms\/media\/error.log<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\/var\/log\/supervisor<\/h3>\n\n\n\n<p>Next candidate is the <code>\/var\/log\/supervisor<\/code> directory. Unfortunately, as the name tells, it&#8217;s a log directory for <code>supervisor<\/code> in general and not for Mayan in particular. Entries in this log are therefore at a much higher level and refer to the function of the supervisor service in general, as the following tail from <code>supervisord.log<\/code> shows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2022-06-28 14:07:35,353 INFO supervisord started with pid 697\n2022-06-28 14:07:36,355 INFO spawned: 'mayan-edms-celery-beat' with pid 859\n2022-06-28 14:07:36,359 INFO spawned: 'mayan-edms-worker_a' with pid 860\n2022-06-28 14:07:36,363 INFO spawned: 'mayan-edms-worker_b' with pid 861\n2022-06-28 14:07:36,367 INFO spawned: 'mayan-edms-worker_c' with pid 862\n2022-06-28 14:07:36,370 INFO spawned: 'mayan-edms-worker_d' with pid 863\n2022-06-28 14:07:36,388 INFO spawned: 'mayan-edms-gunicorn' with pid 864\n2022-06-28 14:07:37,390 INFO success: mayan-edms-gunicorn entered RUNNING state, process has stayed up for &gt; than 1 seconds (startsecs)\n2022-06-28 14:07:45,110 INFO exited: mayan-edms-worker_a (exit status 1; not expected)\n2022-06-28 14:07:46,296 INFO spawned: 'mayan-edms-worker_a' with pid 1122\n2022-06-28 14:07:46,906 INFO success: mayan-edms-celery-beat entered RUNNING state, process has stayed up for &gt; than 10 seconds (startsecs)\n2022-06-28 14:07:46,906 INFO success: mayan-edms-worker_b entered RUNNING state, process has stayed up for &gt; than 10 seconds (startsecs)\n2022-06-28 14:07:46,906 INFO success: mayan-edms-worker_c entered RUNNING state, process has stayed up for &gt; than 10 seconds (startsecs)\n2022-06-28 14:07:46,906 INFO success: mayan-edms-worker_d entered RUNNING state, process has stayed up for &gt; than 10 seconds (startsecs)\n2022-06-28 14:07:47,933 INFO exited: mayan-edms-gunicorn (exit status 3; not expected)\n2022-06-28 14:07:48,285 INFO spawned: 'mayan-edms-gunicorn' with pid 1149\n2022-06-28 14:07:49,438 INFO success: mayan-edms-gunicorn entered RUNNING state, process has stayed up for &gt; than 1 seconds (startsecs)\n2022-06-28 14:07:57,153 INFO success: mayan-edms-worker_a entered RUNNING state, process has stayed up for &gt; than 10 seconds (startsecs)<\/code><\/pre>\n\n\n\n<p>Apart from the relatively straightforward named supervisord.log there are a couple of further, rather cryptically named files relating to celery and gunicorn:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ilek@mayan2:\/var\/log\/supervisor$ ls -alh\ntotal 3.2M\ndrwxr-xr-x  2 root root   4.0K Jun 28 14:07 .\ndrwxrwxr-x 14 root syslog 4.0K Jun 28 14:37 ..\n-rw-------  1 root root      0 Jun 28 14:07 mayan-edms-celery-beat-stderr---supervisor-pfdoonge.log\n-rw-------  1 root root    359 Jun 28 14:07 mayan-edms-celery-beat-stdout---supervisor-uun1p3nz.log\n-rw-------  1 root root   4.4K Jun 28 14:07 mayan-edms-gunicorn-stdout---supervisor-o2wowykm.log\n-rw-------  1 root root   3.8K Jun 28 14:07 mayan-edms-worker_a-stderr---supervisor-w3y0qb_0.log\n-rw-------  1 root root    718 Jun 28 14:07 mayan-edms-worker_a-stdout---supervisor-rmj6m3c3.log\n-rw-------  1 root root    117 Jun 28 14:15 mayan-edms-worker_b-stderr---supervisor-d3vo0pb0.log\n-rw-------  1 root root   1.5K Jun 28 14:07 mayan-edms-worker_b-stdout---supervisor-tr070wk5.log\n-rw-------  1 root root    71K Jun 28 14:36 mayan-edms-worker_c-stderr---supervisor-s_8ukn7t.log\n-rw-------  1 root root   1.2K Jun 28 14:07 mayan-edms-worker_c-stdout---supervisor-unej_5lc.log\n-rw-------  1 root root      0 Jun 28 14:07 mayan-edms-worker_d-stderr---supervisor-ryrhk19q.log\n-rw-------  1 root root    783 Jun 28 14:07 mayan-edms-worker_d-stdout---supervisor-lqky3ctj.log\n-rw-r--r--  1 root root   3.0M Jun 28 14:07 supervisord.log<\/code><\/pre>\n\n\n\n<p>None of those logs is particularly helpful if you want to debug a problem that has its roots inside Mayan (like why a search query returns no value or why thumbnails are not displayed in the document overview).<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Whenever I stumbled around excerpts from error logs on the Mayan EDMS user forum, I asked myself, where and how to access these log files on my system. People happily<span class=\"more-button\"><a href=\"https:\/\/hobbykeller.spdns.de\/?p=1564\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\">Logging in Mayan EDMS<\/span><\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[336,289],"class_list":["post-1564","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-logging","tag-mayan-edms"],"_links":{"self":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts\/1564","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1564"}],"version-history":[{"count":4,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts\/1564\/revisions"}],"predecessor-version":[{"id":1607,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts\/1564\/revisions\/1607"}],"wp:attachment":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}