<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Extensions - Moses Dinakaran</title>
	<atom:link href="https://mosesdinakaran.in/category/extensions/feed/" rel="self" type="application/rss+xml" />
	<link>https://mosesdinakaran.in</link>
	<description>Tutorials and Documentations on Magento</description>
	<lastBuildDate>Fri, 24 Mar 2023 04:42:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>Magento 2 Free Rest API / Elasticsearch / Graphql Logging extension</title>
		<link>https://mosesdinakaran.in/magento-2-free-rest-api-elasticsearch-graphql-logging-extension/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=magento-2-free-rest-api-elasticsearch-graphql-logging-extension</link>
					<comments>https://mosesdinakaran.in/magento-2-free-rest-api-elasticsearch-graphql-logging-extension/#respond</comments>
		
		<dc:creator><![CDATA[mosesdinakaran@gmail.com]]></dc:creator>
		<pubDate>Wed, 12 Oct 2022 16:38:53 +0000</pubDate>
				<category><![CDATA[Extensions]]></category>
		<guid isPermaLink="false">https://mosesdinakaran.in/?p=1322</guid>

					<description><![CDATA[<p>A very lightweight logging module that supports Rest Api Logging Elastic Search Logging GraphQl Logging RabbitMq Logging Varnish Cache Tag Bans Logging No Core files is overridden or modified. These logging are implemented using plugins. To Install For Magento Version &#62;= 2.4.4 For Magento Version &#60; 2.4.4 Supported Logging Rest API Logging ElasticSearch Logging For [&#8230;]</p>
<p>The post <a href="https://mosesdinakaran.in/magento-2-free-rest-api-elasticsearch-graphql-logging-extension/">Magento 2 Free Rest API / Elasticsearch / Graphql Logging extension</a> first appeared on <a href="https://mosesdinakaran.in">Moses Dinakaran</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>A very lightweight logging module that supports</p>



<ul class="wp-block-list"><li>Rest Api Logging</li><li>Elastic Search Logging</li><li>GraphQl Logging</li><li>RabbitMq Logging</li><li>Varnish Cache Tag Bans Logging</li></ul>



<p>No Core files is overridden or modified. These logging are implemented using plugins.</p>



<h2 class="wp-block-heading"><a href="https://github.com/mosesdinakaran/magento-log/blob/main/README.md#to-install"></a>To Install</h2>



<h5 class="wp-block-heading"><a href="https://github.com/mosesdinakaran/magento-log/blob/main/README.md#for-magento-version--244"></a>For Magento Version &gt;= 2.4.4</h5>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: powershell; title: ; notranslate">
composer require moses/magento-log
php bin/magento setup:upgrade

</pre></div>


<h6 class="wp-block-heading"><a href="https://github.com/mosesdinakaran/magento-log/blob/main/README.md#supported-logging"></a></h6>



<h5 class="wp-block-heading"><a href="https://github.com/mosesdinakaran/magento-log/blob/main/README.md#for-magento-version--244-1"></a>For Magento Version &lt; 2.4.4</h5>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
composer require moses/magento-log 1.1.0
php bin/magento setup:upgrade

</pre></div>


<h6 class="wp-block-heading"><a href="https://github.com/mosesdinakaran/magento-log/blob/main/README.md#supported-logging-1"></a>Supported Logging</h6>



<ul class="wp-block-list"><li>Rest API Logging</li><li>ElasticSearch Logging</li></ul>



<p>For Magento version less than 2.4.4 if you need support for GraphQl logging plz try the below (Note its not tested from my end you can give a try)</p>



<ul class="wp-block-list"><li>Add this commit in to your code base&nbsp;<a href="https://github.com/magento/magento2/commit/50c88eb432b4a0880484a4db46165ad431d12a14">https://github.com/magento/magento2/commit/50c88eb432b4a0880484a4db46165ad431d12a14</a></li><li>Post that download this <a href="https://github.com/mosesdinakaran/magento-log.git" target="_blank" rel="noopener">module </a>version 2.1.0 directly from git and then put it under the app/code</li></ul>



<p>Warning : This package cannot be installed via Composer 1.x, please make sure you upgrade to Composer 2+.</p>



<p>Alternatively you can download from github as well&nbsp;<a href="https://github.com/mosesdinakaran/magento-log.git">https://github.com/mosesdinakaran/magento-log.git</a></p>



<p></p>



<style id="bwg-style-0">      #bwg_container1_0 #bwg_container2_0 .image_browser_images_conteiner_0 * {        -moz-box-sizing: border-box;        box-sizing: border-box;      }      #bwg_container1_0 #bwg_container2_0 .image_browser_images_conteiner_0{		background-color: rgba(245, 245, 245, 0.90);		text-align: center;		width: 100%;		border-style: none;		border-width: 2px;		border-color: #F7F7F7;		padding: 4px;		border-radius: 0;		position:relative;      }      #bwg_container1_0 #bwg_container2_0 .image_browser_images_0 {		display: inline-block;		-moz-box-sizing: border-box;		box-sizing: border-box;		font-size: 0;		text-align: center;		max-width: 100%;		width: 100%;      }      #bwg_container1_0 #bwg_container2_0 .image_browser_image_buttons_conteiner_0 {		text-align: center;      }      #bwg_container1_0 #bwg_container2_0 .image_browser_image_buttons_0 {		display: inline-block;		width:100%;      }      #bwg_container1_0 #bwg_container2_0 .bwg_image_browser_image_0 {        background-color: rgba(235, 235, 235, 0.80);		text-align: center;		display: inline-block;		vertical-align: middle;		margin: 2px auto;		padding: 4px;		border-radius: 0;		border: 1px none #F5F5F5;		box-shadow: ;		max-width: 800px;		width: 100%;		/*z-index: 100;*/		position: relative;      }      #bwg_container1_0 #bwg_container2_0 .bwg_image_alt_0{		display: table;		width: 100%;		font-size: 15px;		font-family: Ubuntu;		color: #000000;		text-align:center;		padding-left: 8px;        word-break: break-word;      }      #bwg_container1_0 #bwg_container2_0 .bwg_image_browser_img_0 {        padding: 0 !important;		max-width: 100% !important;		height: inherit !important;		width: 100%;      }      @media only screen and (max-width : 320px) {		#bwg_container1_0 #bwg_container2_0 .displaying-num_0 {		  display: none;		}		#bwg_container1_0 #bwg_container2_0 .bwg_image_alt_0 {		  font-size: 10px !important;		}		#bwg_container1_0 #bwg_container2_0 .bwg_watermark_text_0,		#bwg_container1_0 #bwg_container2_0 .bwg_watermark_text_0:hover {		  font-size: 10px !important;		  text-decoration: none;		  margin: 4px;		  font-family: segoe ui;		  color: #FFFFFF !important;		  opacity: 0.30;		  text-decoration: none;		  position: relative;		  z-index: 10141;		}		#bwg_container1_0 #bwg_container2_0 .bwg_image_browser_image_description_0 {		  color: #000000;		  display: table;		  width: 100%;		  text-align: left;		  font-size: 8px !important;		  font-family: Ubuntu;		  padding: 8px 8px 8px 8px;		  /*word-break: break-all;*/		  border-style: none;		  background-color: #EBEBEB;		  border-radius: 0;		  border-width: 1px;		}		#bwg_container1_0 #bwg_container2_0 .tablenav-pages_0 a {		  font-size: 10px !important;		}      }      #bwg_container1_0 #bwg_container2_0 .bwg_image_browser_image_desp_0 {				display: table;				clear: both;				text-align: center;        padding: 0px 5px 0px 5px;				width: 100%;      }      #bwg_container1_0 #bwg_container2_0 .bwg_image_browser_image_description_0 {        color: #000000;		display: table;		width: 100%;		text-align: left;		font-size: 15px;		font-family: Ubuntu;		padding: 8px 8px 8px 8px;		word-break: break-word;		border-style: none;		background-color: #EBEBEB;		border-radius: 0;		border-width: 1px;      }      #bwg_container1_0 #bwg_container2_0 .bwg_image_browser_image_alt_0 {      	display:table;        clear: both;        text-align: center;        padding: 8px;        width: 100%;      }      /*watermark*/      #bwg_container1_0 #bwg_container2_0 .bwg_watermark_text_0,      #bwg_container1_0 #bwg_container2_0 .bwg_watermark_text_0:hover {        text-decoration: none;        margin: 4px;        font-size: 20px;        font-family: segoe ui;        color: #FFFFFF !important;        opacity: 0.30;        position: relative;        z-index: 10141;      }      #bwg_container1_0 #bwg_container2_0 .bwg_image_browser_image_contain_0{        position: absolute;        text-align: center;        vertical-align: middle;        width: 100%;        height: 100%;        cursor: pointer;      }      #bwg_container1_0 #bwg_container2_0 .bwg_image_browser_watermark_contain_0{        display: table;        vertical-align: middle;        width: 100%;        height: 100%;      }	       #bwg_container1_0 #bwg_container2_0 .bwg_image_browser_watermark_cont_0{        display: table-cell;        text-align: ;        position: relative;        vertical-align: ;      }      #bwg_container1_0 #bwg_container2_0 .bwg_image_browser_watermark_0{		display: inline-block;		overflow: hidden;		position: relative;		vertical-align: middle;		z-index: 10140;		width: 90px;		max-width: 11.25%;		margin: 10px 10px 10px 10px ;      }      #bwg_container1_0 #bwg_container2_0 .bwg_image_browser_watermark_text_0{        display: inline-block;		overflow: hidden;		position: relative;		vertical-align: middle;		z-index: 10140;		margin: 10px 10px 10px 10px;      }      #bwg_container1_0 #bwg_container2_0 .bwg_image_browser_watermark_img_0{        max-width: 100%;        opacity: 0.30;        position: relative;        z-index: 10141;      }      #bwg_container1_0 #bwg_container2_0 .bwg_none_selectable {        -webkit-touch-callout: none;        -webkit-user-select: none;        -khtml-user-select: none;        -moz-user-select: none;        -ms-user-select: none;        user-select: none;       ecoration: none;    }    #bwg_container1_0 #bwg_container2_0 .bwg_gal_title_0 {      background-color: rgba(0, 0, 0, 0);      color: #323A45;      display: block;      font-family: Ubuntu;      font-size: 16px;      font-weight: bold;      padding: 2px;      text-shadow: 0px 0px 0px #888888;      text-align: center;    }    </style>    <div id="bwg_container1_0"         class="bwg_container bwg_thumbnail bwg_image_browser "         data-right-click-protection="0"         data-bwg="0"         data-scroll="0"         data-gallery-type="image_browser"         data-gallery-view-type="image_browser"         data-current-url="/category/extensions/feed/"         data-lightbox-url="https://mosesdinakaran.in/wp-admin/admin-ajax.php?action=GalleryBox&#038;current_view=0&#038;gallery_id=0&#038;tag=0&#038;theme_id=1&#038;shortcode_id=2&#038;sort_by=order&#038;order_by=asc&#038;current_url=%2Fcategory%2Fextensions%2Ffeed%2F"         data-gallery-id="0"         data-popup-width="800"         data-popup-height="500"         data-is-album="gallery"         data-buttons-position="bottom">      <div id="bwg_container2_0">             <div id="ajax_loading_0" class="bwg_loading_div_1">      <div class="bwg_loading_div_2">        <div class="bwg_loading_div_3">          <div id="loading_div_0" class="bwg_spider_ajax_loading">          </div>        </div>      </div>    </div>            <form id="gal_front_form_0"              class="bwg-hidden"              method="post"              action="#"              data-current="0"              data-shortcode-id="2"              data-gallery-type="image_browser"              data-gallery-id="0"              data-tag="0"              data-album-id="0"              data-theme-id="1"              data-ajax-url="https://mosesdinakaran.in/wp-admin/admin-ajax.php?action=bwg_frontend_data">          <div id="bwg_container3_0" class="bwg-background bwg-background-0">            	  <div id="bwg_image_browser_0" class="image_browser_images_conteiner_0 bwg-image_browser-images-wrapper bwg-container"         data-params='{&quot;is_pro&quot;:false,&quot;image_right_click&quot;:0,&quot;gallery_id&quot;:&quot;0&quot;}'         data-bwg="0"         data-lightbox-url="https://mosesdinakaran.in/wp-admin/admin-ajax.php?action=GalleryBox&#038;current_view=0&#038;gallery_id=0&#038;tag=0&#038;theme_id=1&#038;shortcode_id=2&#038;sort_by=order&#038;order_by=asc&#038;current_url=%2Fcategory%2Fextensions%2Ffeed%2F">      <div class="image_browser_images_0">                  <div class="image_browser_image_buttons_conteiner_0">            <div class="image_browser_image_buttons_0">                              <div class="bwg_image_browser_image_alt_0">                  <div class="bwg_image_alt_0" id="alt5">                    MagentoLogging                  </div>                </div>                              <div class="bwg_image_browser_image_0">                                  <a style="position:relative;"  class="bwg-a bwg_lightbox" data-image-id="5" data-elementor-open-lightbox="no">                    <img decoding="async" class="skip-lazy bwg-item0 bwg_image_browser_img bwg_image_browser_img_0 "                         src="https://mosesdinakaran.in/wp-content/uploads/photo-gallery/MagentoLogging.png?bwg=1667664920"                         data-src="https://mosesdinakaran.in/wp-content/uploads/photo-gallery/MagentoLogging.png?bwg=1667664920"                         alt="MagentoLogging"                         title="MagentoLogging" />                  </a>                                </div>                          </div>          </div>                </div>    </div>    <style>      /*pagination styles*/      #bwg_container1_0 #bwg_container2_0 .tablenav-pages_0 {				text-align: center;				font-size: 12px;				font-family: Ubuntu;				font-weight: bold;				color: #666666;				margin: 6px 0 4px;				display: block;      }      @media only screen and (max-width : 320px) {      #bwg_container1_0 #bwg_container2_0 .displaying-num_0 {     	 display: none;      }      }      #bwg_container1_0 #bwg_container2_0 .displaying-num_0 {				font-size: 12px;				font-family: Ubuntu;				font-weight: bold;				color: #666666;				margin-right: 10px;				vertical-align: middle;      }      #bwg_container1_0 #bwg_container2_0 .paging-input_0 {				font-size: 12px;				font-family: Ubuntu;				font-weight: bold;				color: #666666;				vertical-align: middle;      }      #bwg_container1_0 #bwg_container2_0 .tablenav-pages_0 a.disabled,      #bwg_container1_0 #bwg_container2_0 .tablenav-pages_0 a.disabled:hover,      #bwg_container1_0 #bwg_container2_0 .tablenav-pages_0 a.disabled:focus,			#bwg_container1_0 #bwg_container2_0 .tablenav-pages_0 input.bwg_current_page {				cursor: default;				color: rgba(102, 102, 102, 0.5);      }      #bwg_container1_0 #bwg_container2_0 .tablenav-pages_0 a,      #bwg_container1_0 #bwg_container2_0 .tablenav-pages_0 input.bwg_current_page {				cursor: pointer;				text-align: center;				font-size: 12px;				font-family: Ubuntu;				font-weight: bold;				color: #666666;				text-decoration: none;				padding: 3px 6px;				margin: 0;				border-radius: 0;				border-style: solid;				border-width: 1px;				border-color: #E3E3E3;								background-color: rgba(255, 255, 255, 1.00);				box-shadow: 0;				transition: all 0.3s ease 0s;-webkit-transition: all 0.3s ease 0s;      }            #bwg_container1_0 #bwg_container2_0 .tablenav-pages_0 a.next-page:hover,      #bwg_container1_0 #bwg_container2_0 .tablenav-pages_0 a.prev-page:hover {        color: #000000;      }      #bwg_container1_0 #bwg_container2_0 .tablenav-pages_0 .first-page,      #bwg_container1_0 #bwg_container2_0 .tablenav-pages_0 .last-page {        padding: 0% 7%;      }      #bwg_container1_0 #bwg_container2_0 .tablenav-pages_0 .next-page {        margin: 0% 4% 0% 0%;      }      #bwg_container1_0 #bwg_container2_0 .tablenav-pages_0 .prev-page {        margin: 0% 0% 0% 4%;      }      #bwg_container1_0 #bwg_container2_0 .tablenav-pages_0 a {        font-size: 15px !important;        padding: 0% 7% !important;        border-style: none !important;        border-width: 1px;        border-color: #E3E3E3;        background-color: #FFFFFF;        opacity: 1.00;        transition: all 0.3s ease 0s;-webkit-transition: all 0.3s ease 0s;      }      .bwg_image_browser#bwg_container1_0 #bwg_container2_0 .tablenav-pages_0 a {         padding: 0% 11% !important;      }			#bwg_container1_0 #bwg_container2_0 .tablenav-pages_0 {        background-color: rgba(245, 245, 245, 0.90);        margin-top: 0;      }      .bwg_image_browser  .pagination-links_0 {        white-space: nowrap;      }      @media screen and (max-width: 465px) {        .bwg_image_browser#bwg_container1_0 #bwg_container2_0 .tablenav-pages_0 a {          padding: 0% 5% !important;          font-size: 13px;        }      }      </style>      <span class="bwg_nav_cont_0">              <div class="tablenav-pages_0">                      <span class="pagination-links_0 pagination-links" data-pages-count="4">              <span class="pagination-links_col1">              <a class="bwg-a first-page disabled" title="Go to the first page" >«</a>              <a class="bwg-a prev-page disabled" title="Go to the previous page" >‹</a>              </span>							<span class="pagination-links_col2">									<input type="number" class="bwg_current_page" name="bwg_current_page" value="1" data-url-info="page_number_0" onkeypress="return bwg_change_page_0(event, this)" min="1" oninput="validity.valid||(value='')" />										of										<span class="total-pages_0">											4										</span>							</span>              <span class="pagination-links_col3">                <a class="bwg-a next-page-0" title="Go to the next page" href="/category/extensions/feed/?page_number_0=2">›</a>                <a class="bwg-a last-page-0" title="Go to the last page" href="/category/extensions/feed/?page_number_0=4">»</a>              </span>						</span>						        </div>                <input type="hidden" id="page_number_0" name="page_number_0" value="1" />      <script type="text/javascript">        if( jQuery('.bwg_nav_cont_0').length > 1 ) {          jQuery('.bwg_nav_cont_0').first().remove()        }        function spider_page_0(cur, x, y, load_more) {          if (typeof load_more == "undefined") {            var load_more = false;          }          if (jQuery(cur).hasClass('disabled')) {            return false;          }          var items_county_0 = 4;          switch (y) {            case 1:              if (x >= items_county_0) {                document.getElementById('page_number_0').value = items_county_0;              }              else {                document.getElementById('page_number_0').value = x + 1;              }              break;            case 2:              document.getElementById('page_number_0').value = items_county_0;              break;            case -1:              if (x == 1) {                document.getElementById('page_number_0').value = 1;              }              else {                document.getElementById('page_number_0').value = x - 1;              }              break;            case -2:              document.getElementById('page_number_0').value = 1;              break;						case 0:              document.getElementById('page_number_0').value = x;              break;            default:              document.getElementById('page_number_0').value = 1;          }          bwg_ajax('gal_front_form_0', '0', 'bwg_image_browser_0', '0', '', 'gallery', 0, '', '', load_more, '', 1);        }                    jQuery('.first-page disabled').on('click', function () {              spider_page_0(this, 1, -2, 'numeric');              return false;            });            jQuery('.prev-page disabled').on('click', function () {              spider_page_0(this, 1, -1, 'numeric');              return false;            });            jQuery('.next-page-0').on('click', function () {              spider_page_0(this, 1, 1, 'numeric');              return false;            });            jQuery('.last-page-0').on('click', function () {              spider_page_0(this, 1, 2, 'numeric');              return false;            });        				/* Change page on input enter. */        function bwg_change_page_0( e, that ) {          if (  e.key == 'Enter' ) {            var to_page = parseInt(jQuery(that).val());            var pages_count = jQuery(that).parents(".pagination-links").data("pages-count");            var current_url_param = jQuery(that).attr('data-url-info');            if (to_page > pages_count) {              to_page = 1;            }	 												spider_page_0(this, to_page, 0, 'numeric');							return false;						          }          return true;        }        jQuery('.bwg_load_btn_0').on('click', function () {            spider_page_0(this, 1, 1, true);            return false;        });      </script>      </span>                </div>        </form>        <style>          #bwg_container1_0 #bwg_container2_0 #spider_popup_overlay_0 {          background-color: #EEEEEE;          opacity: 0.60;          }          </style>        <div id="bwg_spider_popup_loading_0" class="bwg_spider_popup_loading"></div>        <div id="spider_popup_overlay_0" class="spider_popup_overlay" onclick="spider_destroypopup(1000)"></div>        <input type="hidden" id="bwg_random_seed_0" value="1407101119">                </div>    </div>    <script>      if (document.readyState === 'complete') {        if( typeof bwg_main_ready == 'function' ) {          if ( jQuery("#bwg_container1_0").height() ) {            bwg_main_ready(jQuery("#bwg_container1_0"));          }        }      } else {        document.addEventListener('DOMContentLoaded', function() {          if( typeof bwg_main_ready == 'function' ) {            if ( jQuery("#bwg_container1_0").height() ) {             bwg_main_ready(jQuery("#bwg_container1_0"));            }          }        });      }    </script>    



<p></p>



<h2 class="wp-block-heading">Rest API Logging</h2>



<p>This API logging extension provides an options to log all/specific api calls.</p>



<p>In most of our environment we use different third party services such as order management, product management, product search , shipping management etc. These services interact with Magento using Rest APi'S.</p>



<p>At times it would become very difficult to identify the root cause if we face any problem with these services.</p>



<p>Moreover if we are in headless environment primarily using rest apis it would be really hard to identify the root cause for certain issues.</p>



<p>Consider a scenario where add to cart is not working for a particular customer only.</p>



<p>To effectively debug this issue, we would require the post data, headers etc that is posted by that particular user.</p>



<p>This extension would help you in this scenario. It has the feature that we can log the api request that is made by a specific user.</p>



<p>Let see the complete features of this extension.</p>



<h5 class="wp-block-heading"><a href="https://github.com/mosesdinakaran/magento-log#features"></a>Features</h5>



<p>Enable or Disable Logging through Admin Configuration</p>



<p>Able to configure the api urls that needs to be logged using regular expression which will give endless opportunity to the developer to log a specific url</p>



<p>Few such ex are</p>



<ul class="wp-block-list"><li>Able to log all the API logs</li><li>Able to log logged in users API calls</li><li>Able to log guest user API calls</li><li>Able to log only a specific api calls such as custom api call, cart, CMS, Product, Order etc</li><li>Able to log a specific user api calls.</li><li>The API logs contain both the request and Response</li><li>The logs are made in a separate file</li><li>This extension doesn't override any CORE Api class.</li></ul>



<p>This can be safely deployed in Production environment as its very light weight.<a href="https://github.com/mosesdinakaran/magento-log#to-install"></a></p>



<h5 class="wp-block-heading"><a href="https://github.com/mosesdinakaran/magento-log#configuration"></a>Configuration</h5>



<p>Stores -> Configuration -> Moses Extensions -> API Logging</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="343" src="https://mosesdinakaran.in/wp-content/uploads/2023/03/image-26-1024x343.png" alt="" class="wp-image-2270" srcset="https://mosesdinakaran.in/wp-content/uploads/2023/03/image-26-1024x343.png 1024w, https://mosesdinakaran.in/wp-content/uploads/2023/03/image-26-300x100.png 300w, https://mosesdinakaran.in/wp-content/uploads/2023/03/image-26-768x257.png 768w, https://mosesdinakaran.in/wp-content/uploads/2023/03/image-26.png 1105w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Enable API Logging : To Enable all/selected api calls</p>



<p>Regular Expression Patterns: Define the regular expression pattern to log selected urls, For more than one urls use next line.</p>



<p>Ex</p>



<p>V1/carts/9 : Matches all urls for quote ID 9 that contains V1/carts/9</p>



<p>V1/carts/(\d)* : Matches for all quotes</p>



<p>V1/checkoutcomupapi/getTokenList : Match a specific url</p>



<h5 class="wp-block-heading"><a href="https://github.com/mosesdinakaran/magento-log#output"></a>Output</h5>



<p>Once the API Logging is enabled, The request and response will be available in the below log file MAGE_ROOT/var/log/moses-logging.log</p>



<h2 class="wp-block-heading"><a href="https://github.com/mosesdinakaran/magento-log#elastic-search-logging"></a>Elastic Search Logging</h2>



<p>At times there might me a case where you need to find out exactly what data is being pushed to elastic search and what is the response that we receive. This extension will help you to do that. It will log all the request and response of ElasticSearch from Magento.</p>



<h5 class="wp-block-heading"><a href="https://github.com/mosesdinakaran/magento-log#configuration-1"></a>Configuration</h5>



<p>Stores -&gt; Configuration -&gt; Moses Extensions -&gt; Elastic Search Logging</p>



<h5 class="wp-block-heading"><a href="https://github.com/mosesdinakaran/magento-log#output-1"></a>Output</h5>



<p>Once the Elasticsearch Logging is enabled, all the communication between magento and elastic search are logged here MAGE_ROOT/var/log/moses-logging.log</p>



<h5 class="wp-block-heading"><a href="https://github.com/mosesdinakaran/magento-log#how-it-works"></a>How it works</h5>



<p>The implementation is not very complicated its quiet simple though.</p>



<p>Magento uses the third party api client "elasticsearch/elasticsearch" to interact with ElasticSearch. This Extension by default has the feature of logging the request and responses.</p>



<p>\Elasticsearch\Connections\Connection::logRequestSuccess</p>



<p>But while creating the instance of this elasticsearch model, Magento always set the logger to be NULL due to which the the request never get logged. This extension thorugh a pluging sets this looger to a custom logger, Due to which the requests and the response are logged.</p>



<h2 class="wp-block-heading">GraphQl Logging</h2>



<p>GraphQl logging is supported only for magento version greater than or equal to 2.4.4</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="530" src="https://mosesdinakaran.in/wp-content/uploads/2023/03/image-27-1024x530.png" alt="" class="wp-image-2271" srcset="https://mosesdinakaran.in/wp-content/uploads/2023/03/image-27-1024x530.png 1024w, https://mosesdinakaran.in/wp-content/uploads/2023/03/image-27-300x155.png 300w, https://mosesdinakaran.in/wp-content/uploads/2023/03/image-27-768x398.png 768w, https://mosesdinakaran.in/wp-content/uploads/2023/03/image-27.png 1047w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h5 class="wp-block-heading">Features</h5>



<ul class="wp-block-list"><li>Able to log GET/POST Requests or All Requests</li><li>Able to log Based on HTTP Header Values</li><li>Able to log Based on Query types<ul><li>product : To log only the product query type</li><li>product,categories : To log both product and categories query types</li></ul></li></ul>



<h5 class="wp-block-heading"><a href="https://github.com/mosesdinakaran/magento-log/blob/main/README.md#configuration-2"></a></h5>



<h5 class="wp-block-heading">Configuration</h5>



<p>Stores -&gt; Configuration -&gt; Moses Extensions -&gt; Graphql Logging</p>



<h2 class="wp-block-heading">RabbitMq Logging</h2>



<p>To log the RabbitMq Messages that are send from Magento to RabbitMq Server or that are cosumed by Magento from RabbitMq.</p>



<h5 class="wp-block-heading"><a href="https://github.com/mosesdinakaran/magento-log/edit/main/README.md#configuration-3"></a>Configuration</h5>



<p>Stores -> Configuration -> Moses Extensions -> RabbitMq Logging</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="210" src="https://mosesdinakaran.in/wp-content/uploads/2023/03/image-28-1024x210.png" alt="" class="wp-image-2274" srcset="https://mosesdinakaran.in/wp-content/uploads/2023/03/image-28-1024x210.png 1024w, https://mosesdinakaran.in/wp-content/uploads/2023/03/image-28-300x62.png 300w, https://mosesdinakaran.in/wp-content/uploads/2023/03/image-28-768x158.png 768w, https://mosesdinakaran.in/wp-content/uploads/2023/03/image-28.png 1106w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h5 class="wp-block-heading"><a href="https://github.com/mosesdinakaran/magento-log/edit/main/README.md#features-2"></a>Features</h5>



<ul class="wp-block-list"><li>Able to log Outging Messages (The Messages that are published to RabbitMq Server)</li><li>Able to log Incomming Messages (The messages that are consumed from RabbitMq Server)</li></ul>



<h5 class="wp-block-heading"><a href="https://github.com/mosesdinakaran/magento-log/blob/main/README.md#output-2"></a></h5>



<h2 class="wp-block-heading">Varnish Cache Tags Logging</h2>



<p>To log the varnish purge cache tags, To know more on this&nbsp;<a href="https://mosesdinakaran.in/magento-2-full-page-caching-with-varnish-in-depth/#Configure_Commerce_to_purge_Varnish">please refer here</a></p>



<h3 class="wp-block-heading"><a href="https://github.com/mosesdinakaran/magento-log#configuration-4"></a>Configuration</h3>



<p>Stores -&gt; Configuration -&gt; Moses Extensions -&gt; Log Varnish Cache Purging Tags</p>



<h5 class="wp-block-heading">Output</h5>



<p>Once the GraphqlLogging is enabled, The graphql request and response will be available in the below log file MAGE_ROOT/var/log/moses-logging.log</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Please note that, This extension is for debugging purpose only, Once enabled this extension will write all/partial request and response to the log file based on your configuration, So plz be advised that keeping this extension on enabled mode for a long time will fill up your disk space. Once the debugging is completed this needs to be disabled</p></blockquote>



<p></p>



<p></p><p>The post <a href="https://mosesdinakaran.in/magento-2-free-rest-api-elasticsearch-graphql-logging-extension/">Magento 2 Free Rest API / Elasticsearch / Graphql Logging extension</a> first appeared on <a href="https://mosesdinakaran.in">Moses Dinakaran</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://mosesdinakaran.in/magento-2-free-rest-api-elasticsearch-graphql-logging-extension/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
