{"id":1921,"date":"2017-12-07T14:38:24","date_gmt":"2017-12-07T19:38:24","guid":{"rendered":"http:\/\/lisa.rushworth.us\/?p=1921"},"modified":"2017-12-07T14:38:58","modified_gmt":"2017-12-07T19:38:58","slug":"logging-openhabs-karaf-console-to-a-file","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=1921","title":{"rendered":"Logging OpenHAB&#8217;s Karaf Console To A File"},"content":{"rendered":"<p>With OpenHAB2, there is a console where information is displayed. You can copy\/paste from the console to save information, but if you are\u00a0<em>reproducing<\/em> an issue and\u00a0<em>expect<\/em> something to be logged, you can also dump the information from the console into a text file. This is done by ssh&#8217;ing into the Karaf console and using tee to write output to a file.\u00a0Since the SSH server is bound to 127.0.0.1, you will\u00a0<em>need<\/em> to use localhost or 127.0.0.1. This cannot be done remotely without some sort of firewall port redirection or OpenHAB change<\/p>\n<pre>     ssh UserName@localhost -p 8101 | tee -a \/tmp\/test.txt<\/pre>\n<p>So what&#8217;s the username? Karaf uses karaf as the username and password. OpenHAB uses the\u00a0users.properties file (.\/openhab2\/userdata\/etc) to store users. Our file has the user openhab. You can google the default password or put your own crypt string in there and\u00a0<em>know<\/em> the password.<\/p>\n<p>Now everything that comes across the Karaf console (system output\u00a0<em>and<\/em> stuff you type) will be in the \/tmp\/test.txt file.<\/p>\n<pre>[root@fedora01 ~]# tail -f \/tmp\/test.txt\r\n\r\n                          __  _____    ____\r\n  ____  ____  ___  ____  \/ \/ \/ \/   |  \/ __ )\r\n \/ __ \\\/ __ \\\/ _ \\\/ __ \\\/ \/_\/ \/ \/| | \/ __  |\r\n\/ \/_\/ \/ \/_\/ \/  __\/ \/ \/ \/ __  \/ ___ |\/ \/_\/ \/\r\n\\____\/ .___\/\\___\/_\/ \/_\/_\/ \/_\/_\/  |_\/_____\/\r\n    \/_\/                        2.2.0-SNAPSHOT\r\n                               Build #1114\r\n\r\nHit '' for a list of available commands\r\nand '[cmd] --help' for help on a specific command.\r\nHit '' or type 'system:shutdown' or 'logout' to shutdown openHAB.\r\n\r\nopenhab&gt; bundle:list\r\nSTART LEVEL 100 , List Threshold: 50\r\n ID \u2502 State    \u2502 Lvl \u2502 Version                \u2502 Name\r\n\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\r\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\r\n 15 \u2502 Active   \u2502  80 \u2502 2.2.0.201712061711     \u2502 ZWave Binding\r\n 16 \u2502 Active   \u2502  80 \u2502 2.2.0.201712052342     \u2502 ZigBee Binding\r\n 17 \u2502 Active   \u2502  80 \u2502 5.3.1.201602281253     \u2502 OSGi JAX-RS Connector\r\n 18 \u2502 Active   \u2502  80 \u2502 2.4.5                  \u2502 Jackson-annotations\r\n 19 \u2502 Active   \u2502  80 \u2502 2.4.5                  \u2502 Jackson-core\r\n 20 \u2502 Active   \u2502  80 \u2502 2.4.5                  \u2502 jackson-databind\r\n 21 \u2502 Active   \u2502  80 \u2502 2.4.5                  \u2502 Jackson-dataformat-XML\r\n 22 \u2502 Active   \u2502  80 \u2502 2.4.5                  \u2502 Jackson-dataformat-YAML\r\n 23 \u2502 Active   \u2502  80 \u2502 2.4.5                  \u2502 Jackson-module-JAXB-annotations\r\n 24 \u2502 Active   \u2502  80 \u2502 2.7.0                  \u2502 Gson\r\n 25 \u2502 Active   \u2502  80 \u2502 18.0.0                 \u2502 Guava: Google Core Libraries for Java\r\n 26 \u2502 Active   \u2502  80 \u2502 3.0.0.v201312141243    \u2502 Google Guice (No AOP)\r\n 27 \u2502 Active   \u2502  80 \u2502 3.12.0.OH              \u2502 nrjavaserial\r\n 28 \u2502 Active   \u2502  80 \u2502 1.5.8                  \u2502 swagger-annotations\r\n 29 \u2502 Active   \u2502  80 \u2502 3.19.0.GA              \u2502 Javassist\r\n 31 \u2502 Active   \u2502  80 \u2502 3.5.2                  \u2502 JmDNS\r\n 34 \u2502 Active   \u2502  80 \u2502 1.1.0.Final            \u2502 Bean Validation API\r\n 36 \u2502 Active   \u2502  80 \u2502 2.0.1                  \u2502 javax.ws.rs-api\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>With OpenHAB2, there is a console where information is displayed. You can copy\/paste from the console to save information, but if you are\u00a0reproducing an issue and\u00a0expect something to be logged, you can also dump the information from the console into a text file. This is done by ssh&#8217;ing into the Karaf console and using tee &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[63,29],"tags":[44,394],"class_list":["post-1921","post","type-post","status-publish","format-standard","hentry","category-home-automation","category-technology","tag-openhab","tag-openhab2"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/1921","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1921"}],"version-history":[{"count":4,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/1921\/revisions"}],"predecessor-version":[{"id":1933,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/1921\/revisions\/1933"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1921"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1921"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}