{"id":5967,"date":"2018-11-26T00:33:48","date_gmt":"2018-11-26T00:33:48","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=5967"},"modified":"2018-11-26T00:33:48","modified_gmt":"2018-11-26T00:33:48","slug":"tensorflow-where-do-log-files-go","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/tensorflow-where-do-log-files-go\/","title":{"rendered":"Tensorflow- where do log files go?"},"content":{"rendered":"<p>In order for Tensorflow logs to go somewhere, you need to register a handler.<\/p>\n<p>From<sup><a href=\"#footnote_0_5967\" id=\"identifier_0_5967\" class=\"footnote-link footnote-identifier-link\" title=\"https:\/\/stackoverflow.com\/questions\/40559667\/how-to-redirect-tensorflow-logging-to-a-file\">1<\/a><\/sup><\/p>\n<pre lang=\"python\">\nimport logging\n\nlog = logging.getLogger('tensorflow')\nlog.setLevel(logging.DEBUG)\n\nformatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')\n\nfh = logging.FileHandler('tensorflow' + datetime.now().strftime(\"%Y%m%d%H%M%S\") +'.log')\nfh.setLevel(logging.DEBUG)\nfh.setFormatter(formatter)\nlog.addHandler(fh)\n<\/pre>\n<ol class=\"footnotes\"><li id=\"footnote_0_5967\" class=\"footnote\">https:\/\/stackoverflow.com\/questions\/40559667\/how-to-redirect-tensorflow-logging-to-a-file<span class=\"footnote-back-link-wrapper\"> [<a href=\"#identifier_0_5967\" class=\"footnote-link footnote-back-link\">&#8617;<\/a>]<\/span><\/li><\/ol>","protected":false},"excerpt":{"rendered":"<p>Where do tensorflow logs go?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[447,540],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/5967"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=5967"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/5967\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=5967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=5967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=5967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}