{"id":2760,"date":"2018-11-29T17:36:27","date_gmt":"2018-11-29T15:36:27","guid":{"rendered":"http:\/\/hasselba.ch\/blog\/?p=2760"},"modified":"2018-11-29T17:36:27","modified_gmt":"2018-11-29T15:36:27","slug":"node-js-domino-db-docker-13-logging-grpc-requests","status":"publish","type":"post","link":"https:\/\/hasselba.ch\/blog\/?p=2760","title":{"rendered":"node.js, domino-db &#038; Docker (13): Logging gRPC requests"},"content":{"rendered":"<p>For logging the gRPC requests you can use nginx as a reverse proxy. <a href=\"https:\/\/www.nginx.com\/blog\/nginx-1-13-10-grpc\/\" target=\"_blank\" rel=\"noopener\">gRPC support was added in version 1.13.10<\/a>.<\/p>\n<p>To install it locally on your Domino server (RHEL), open a terminal and do the following:<\/p>\n<h2>1. Identify which version you are running<\/h2>\n<pre><code>cat \/etc\/redhat-release<\/code><\/pre>\n<p>The resulting output tells you which major version you are using:<\/p>\n<pre><code>[notes@redhat-dev-hq \/]$ cat \/etc\/redhat-release \r\nRed Hat Enterprise Linux Server release 7.6 (Maipo)<\/code><\/pre>\n<h2>2. Add the nginx repository<\/h2>\n<pre><code>sudo vi \/etc\/yum.repos.d\/nginx.repo<\/code><\/pre>\n<h2>3. Add the repo data<\/h2>\n<pre><code>[nginx]\r\nname=nginx repo\r\nbaseurl=http:\/\/nginx.org\/packages\/rhel\/<strong>7<\/strong>\/$basearch\/\r\ngpgcheck=0\r\nenabled=1<\/code><\/pre>\n<p>The &#8222;7&#8220; in the base url is the major version from step 1.<\/p>\n<h2>4. Install nginx<\/h2>\n<pre><code>sudo yum install nginx<\/code><\/pre>\n<h2>5. Create a new config for gRPC<\/h2>\n<pre><code>sudo vi \/etc\/nginx\/conf.d\/grpc.conf<\/code><\/pre>\n<h2>6. Add the debug log configuration<\/h2>\n<pre><code>server {\r\n     listen 81 http2;\r\n\r\n     access_log \/var\/log\/nginx\/grpc-access.log main;\r\n     error_log \/var\/log\/nginx\/grpc-debug.log debug;\r\n\r\n     location \/ {\r\n        grpc_pass grpc:\/\/localhost:3002;\r\n     }\r\n}<\/code><\/pre>\n<p>The reverse proxy is now listening on port 81. You have to change the port in the application configuration. The &#8222;<em>error_log<\/em>&#8220; is our debug log, the &#8222;<em>access_log<\/em>&#8220; logs just the requests itself.<\/p>\n<p>If you are new to vim: First you have to press &#8222;<em>i<\/em>&#8220; to insert text. After pasting the configuration above, press <em>&lt;ESC&gt;<\/em>, then <em>:w&lt;ENTER&gt;<\/em>, then <em>:q&lt;ENTER&gt;<\/em><\/p>\n<h2>7. Test the configuration<\/h2>\n<pre><code>[notes@redhat-dev-hq \/]$ sudo nginx -t\r\nnginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\r\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful<\/code><\/pre>\n<h2>8. Start the nginx debug task &amp; enjoy the results<\/h2>\n<pre><code>sudo service nginx stop\r\nsudo service nginx-debug start<\/code><\/pre>\n<p>Now the log file is full with the complete debug information about the incoming gRPC request.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For logging the gRPC requests you can use nginx as a reverse proxy. gRPC support was added in version 1.13.10. To install it locally on your Domino server (RHEL), open a terminal and do the following: 1. Identify which version &hellip; <a href=\"https:\/\/hasselba.ch\/blog\/?p=2760\">Weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[144,10],"class_list":["post-2760","post","type-post","status-publish","format-standard","hentry","category-allgemein","tag-grpc","tag-reverse-proxy"],"_links":{"self":[{"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2760","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2760"}],"version-history":[{"count":1,"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2760\/revisions"}],"predecessor-version":[{"id":2762,"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2760\/revisions\/2762"}],"wp:attachment":[{"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasselba.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}