{"id":3014,"date":"2021-05-31T21:28:00","date_gmt":"2021-05-31T09:28:00","guid":{"rendered":"https:\/\/www.talkcrypto.org\/blog\/?p=3014"},"modified":"2023-11-27T19:55:10","modified_gmt":"2023-11-27T06:55:10","slug":"how-to-turn-on-logging-in-subquery","status":"publish","type":"post","link":"https:\/\/www.talkcrypto.org\/blog\/2021\/05\/31\/how-to-turn-on-logging-in-subquery\/","title":{"rendered":"How to turn on logging in SubQuery?"},"content":{"rendered":"\n<p>In SubQuery, you can log messages on 3 different levels. They are:<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>logger.info(\"info\")\nlogger.debug(\"debug\")\nlogger.warn(\"warning\")<\/code><\/pre>\n\n\n\n<p>For example, adding &#8220;logger.info(&#8220;info test&#8221;)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"585\" height=\"168\" src=\"https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/07\/image.png\" alt=\"\" class=\"wp-image-3015\" srcset=\"https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/07\/image.png 585w, https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/07\/image-300x86.png 300w\" sizes=\"(max-width: 585px) 100vw, 585px\" \/><\/figure>\n\n\n\n<p>results in:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"232\" src=\"https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/07\/image-1-1024x232.png\" alt=\"\" class=\"wp-image-3016\" srcset=\"https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/07\/image-1-1024x232.png 1024w, https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/07\/image-1-300x68.png 300w, https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/07\/image-1-768x174.png 768w, https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/07\/image-1.png 1472w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The same can be done with warnings. However, to add a debug log, an extra modification needs to be made. The docker-compose.yaml file needs to have an additional &#8211;log-level=debug command passed to it. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>command:\n      - --log-level=debug<\/code><\/pre>\n\n\n\n<p>Here is a screenshot of the docker-compose.yaml file from the Hello World starter project. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"311\" height=\"321\" src=\"https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/07\/image-2.png\" alt=\"\" class=\"wp-image-3017\" srcset=\"https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/07\/image-2.png 311w, https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/07\/image-2-291x300.png 291w\" sizes=\"(max-width: 311px) 100vw, 311px\" \/><\/figure>\n\n\n\n<p>Also don&#8217;t forget to regenerate and build the code first via:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yarn codegen\nyarn build<\/code><\/pre>\n\n\n\n<p>and then running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker-compose up<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In SubQuery, you can log messages on 3 different levels.<\/p>\n","protected":false},"author":1,"featured_media":3403,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-3014","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blockchain"],"featured_image_urls":{"full":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/05\/logs.jpg",800,536,false],"thumbnail":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/05\/logs-150x150.jpg",150,150,true],"medium":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/05\/logs-300x201.jpg",300,201,true],"medium_large":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/05\/logs-768x515.jpg",640,429,true],"large":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/05\/logs.jpg",640,429,false],"1536x1536":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/05\/logs.jpg",800,536,false],"2048x2048":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/05\/logs.jpg",800,536,false],"chromenews-featured":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/05\/logs.jpg",800,536,false],"chromenews-large":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/05\/logs.jpg",800,536,false],"chromenews-medium":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2021\/05\/logs-590x410.jpg",590,410,true]},"author_info":{"info":["seandotau"]},"category_info":"<a href=\"https:\/\/www.talkcrypto.org\/blog\/category\/blockchain\/\" rel=\"category tag\">Blockchain<\/a>","tag_info":"Blockchain","comment_count":"0","_links":{"self":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts\/3014","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/comments?post=3014"}],"version-history":[{"count":1,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts\/3014\/revisions"}],"predecessor-version":[{"id":3018,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts\/3014\/revisions\/3018"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/media\/3403"}],"wp:attachment":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/media?parent=3014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/categories?post=3014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/tags?post=3014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}