{"id":319,"date":"2017-07-15T14:33:20","date_gmt":"2017-07-15T14:33:20","guid":{"rendered":"https:\/\/kevingoedecke.com\/?p=319"},"modified":"2017-07-16T13:55:27","modified_gmt":"2017-07-16T13:55:27","slug":"beanstalk-woocommerce-logs","status":"publish","type":"post","link":"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/","title":{"rendered":"Add WooCommerce logs to AWS Beanstalk"},"content":{"rendered":"<p>In order to run a high performant and scaling WordPress site including WooCommerce <a href=\"https:\/\/aws.amazon.com\/elasticbeanstalk\/\">Elastic Beanstalk <\/a>in combination with <a href=\"https:\/\/aws.amazon.com\/rds\/\">RDS<\/a> is a good way to go.<\/p>\n<p>In an upcoming tutorial I will cover how you&#8217;ll setup a WordPress site on AWS Beanstalk. If you&#8217;ve already setup your site you might come across the problem that you want to access custom log files including the ones that are produced by WooCommerce and it&#8217;s various payment gateways.<\/p>\n<p>When working with Beanstalk you should never SSH into the underlying EC2 instance to access log files or similar stuff. AWS provides you with a way to access all logs through the Dashboard. By default the Apache and PHP log files are included in what the dashboard collects.<\/p>\n<figure id=\"attachment_321\" aria-describedby=\"caption-attachment-321\" style=\"width: 2784px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/wordpress-beanstalk-logs@2x.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-321 size-full\" src=\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/wordpress-beanstalk-logs@2x.jpg\" alt=\"\" width=\"2784\" height=\"1690\" srcset=\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/wordpress-beanstalk-logs@2x.jpg 2784w, https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/wordpress-beanstalk-logs@2x-300x182.jpg 300w, https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/wordpress-beanstalk-logs@2x-768x466.jpg 768w, https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/wordpress-beanstalk-logs@2x-1024x622.jpg 1024w\" sizes=\"auto, (max-width: 2784px) 100vw, 2784px\" \/><\/a><figcaption id=\"caption-attachment-321\" class=\"wp-caption-text\">AWS Beanstalk logs files for WordPress &amp; WooCommerce<\/figcaption><\/figure>\n<p>Let&#8217;s go ahead now and add the custom logs to Beanstalk.<\/p>\n<h2>1. Retrieve WooCommerce Log Path<\/h2>\n<p>The default log path for WooCommerce on Elastic Beanstalk should be:<\/p>\n<pre class=\"lang:default decode:true\">\/var\/app\/current\/wp-content\/uploads\/wc-logs\/*<\/pre>\n<p>Make sure your path is the same by opening the WordPress admin panel and then<\/p>\n<p>WooCommerce -&gt; Settings -&gt; PayPal<\/p>\n<p>This will show you the log path of the PayPal payment gateway, which logs into the same folder as WooCommerce.<\/p>\n<p><a href=\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/woocommerce-log-path@2x.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-325\" src=\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/woocommerce-log-path@2x-1024x622.jpg\" alt=\"Retrieve WooCommerce Log Path\" width=\"1024\" height=\"622\" srcset=\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/woocommerce-log-path@2x-1024x622.jpg 1024w, https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/woocommerce-log-path@2x-300x182.jpg 300w, https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/woocommerce-log-path@2x-768x466.jpg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<h2>2. Add Path to Beanstalk log tasks<\/h2>\n<p>In order to add the logs of WooCommerce to Beanstalk you need to add a config file in <span class=\"lang:default decode:true crayon-inline\">.ebextensions<\/span>\u00a0 to your project<\/p>\n<p>If you don&#8217;t have the\u00a0<span class=\"lang:default decode:true crayon-inline \">.ebextensions<\/span>\u00a0folder already in your project, go ahead an create it now.<\/p>\n<p>Now in the\u00a0<span class=\"lang:default decode:true crayon-inline \">.ebextensions<\/span>\u00a0 folder create a new file and name it <span class=\"lang:default decode:true crayon-inline \">wc-logs.config<\/span>\u00a0. Add the following content to the file:<\/p>\n<pre class=\"lang:default decode:true\">#####################################################\r\n#### Adds WooCommerce log files to Beanstalk log ####\r\n#####################################################\r\n\r\nfiles:\r\n  # Add WooCommerce logs to tail logs\r\n  \"\/opt\/elasticbeanstalk\/tasks\/taillogs.d\/wc-logs.config\" :\r\n    mode: \"000755\"\r\n    owner: root\r\n    group: root\r\n    content: |\r\n      \/var\/app\/current\/wp-content\/uploads\/wc-logs\/*.log\r\n  # Add WooCommerce logs to bundle logs\r\n  \"\/opt\/elasticbeanstalk\/tasks\/bundlelogs.d\/wc-logs.config\" :\r\n    mode: \"000755\"\r\n    owner: root\r\n    group: root\r\n    content: |\r\n      \/var\/app\/current\/wp-content\/uploads\/wc-logs\/*.log\r\n<\/pre>\n<p>This YAML file tells Beanstalk to add the directory where all WooCommerce log files are to the bundle logs and the tail logs.<\/p>\n<p>The Bundle logs contain all log files, whereas the tail log only contains the last 100 lines of the log files.<\/p>\n<p>If your log path was different from the default path in step 1, adjust it accordingly.<\/p>\n<h2>3. Deploy your updated app<\/h2>\n<p>Now save everything and deploy your app to Elastic Beanstalk. All your WooCommerce logs should now being collected through the AWS Beanstalk log task.<\/p>\n<p>Happy logging \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In order to run a high performant and scaling WordPress site including WooCommerce Elastic Beanstalk in combination with RDS is a good way to go. In an upcoming tutorial I will cover how you&#8217;ll setup a WordPress site on AWS Beanstalk. If you&#8217;ve already setup your site you might come across the problem that you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":320,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[25],"tags":[],"class_list":["post-319","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Add WooCommerce logs to AWS Beanstalk - Kevin Goedecke<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Add WooCommerce logs to AWS Beanstalk - Kevin Goedecke\" \/>\n<meta property=\"og:description\" content=\"In order to run a high performant and scaling WordPress site including WooCommerce Elastic Beanstalk in combination with RDS is a good way to go. In an upcoming tutorial I will cover how you&#8217;ll setup a WordPress site on AWS Beanstalk. If you&#8217;ve already setup your site you might come across the problem that you [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/\" \/>\n<meta property=\"og:site_name\" content=\"Kevin Goedecke\" \/>\n<meta property=\"article:published_time\" content=\"2017-07-15T14:33:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-07-16T13:55:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/woocommerce-logs-aws-beanstalk@2x.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"900\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Kevin Goedecke\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kevin Goedecke\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/\",\"url\":\"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/\",\"name\":\"Add WooCommerce logs to AWS Beanstalk - Kevin Goedecke\",\"isPartOf\":{\"@id\":\"https:\/\/kevingoedecke.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/woocommerce-logs-aws-beanstalk@2x.jpg\",\"datePublished\":\"2017-07-15T14:33:20+00:00\",\"dateModified\":\"2017-07-16T13:55:27+00:00\",\"author\":{\"@id\":\"https:\/\/kevingoedecke.com\/#\/schema\/person\/4b156cd6453e1af4bab9076b0a663871\"},\"breadcrumb\":{\"@id\":\"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/#primaryimage\",\"url\":\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/woocommerce-logs-aws-beanstalk@2x.jpg\",\"contentUrl\":\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/woocommerce-logs-aws-beanstalk@2x.jpg\",\"width\":1800,\"height\":900,\"caption\":\"Beanstalk WooCommerce Logs\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/kevingoedecke.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Add WooCommerce logs to AWS Beanstalk\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kevingoedecke.com\/#website\",\"url\":\"https:\/\/kevingoedecke.com\/\",\"name\":\"Kevin Goedecke\",\"description\":\"Founder. Entrepreneur.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kevingoedecke.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/kevingoedecke.com\/#\/schema\/person\/4b156cd6453e1af4bab9076b0a663871\",\"name\":\"Kevin Goedecke\",\"url\":\"https:\/\/kevingoedecke.com\/blog\/author\/kgoedecke\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Add WooCommerce logs to AWS Beanstalk - Kevin Goedecke","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/","og_locale":"en_US","og_type":"article","og_title":"Add WooCommerce logs to AWS Beanstalk - Kevin Goedecke","og_description":"In order to run a high performant and scaling WordPress site including WooCommerce Elastic Beanstalk in combination with RDS is a good way to go. In an upcoming tutorial I will cover how you&#8217;ll setup a WordPress site on AWS Beanstalk. If you&#8217;ve already setup your site you might come across the problem that you [&hellip;]","og_url":"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/","og_site_name":"Kevin Goedecke","article_published_time":"2017-07-15T14:33:20+00:00","article_modified_time":"2017-07-16T13:55:27+00:00","og_image":[{"width":1800,"height":900,"url":"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/woocommerce-logs-aws-beanstalk@2x.jpg","type":"image\/jpeg"}],"author":"Kevin Goedecke","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kevin Goedecke","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/","url":"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/","name":"Add WooCommerce logs to AWS Beanstalk - Kevin Goedecke","isPartOf":{"@id":"https:\/\/kevingoedecke.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/#primaryimage"},"image":{"@id":"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/#primaryimage"},"thumbnailUrl":"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/woocommerce-logs-aws-beanstalk@2x.jpg","datePublished":"2017-07-15T14:33:20+00:00","dateModified":"2017-07-16T13:55:27+00:00","author":{"@id":"https:\/\/kevingoedecke.com\/#\/schema\/person\/4b156cd6453e1af4bab9076b0a663871"},"breadcrumb":{"@id":"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/#primaryimage","url":"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/woocommerce-logs-aws-beanstalk@2x.jpg","contentUrl":"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/woocommerce-logs-aws-beanstalk@2x.jpg","width":1800,"height":900,"caption":"Beanstalk WooCommerce Logs"},{"@type":"BreadcrumbList","@id":"https:\/\/kevingoedecke.com\/blog\/2017\/07\/15\/beanstalk-woocommerce-logs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kevingoedecke.com\/"},{"@type":"ListItem","position":2,"name":"Add WooCommerce logs to AWS Beanstalk"}]},{"@type":"WebSite","@id":"https:\/\/kevingoedecke.com\/#website","url":"https:\/\/kevingoedecke.com\/","name":"Kevin Goedecke","description":"Founder. Entrepreneur.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kevingoedecke.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/kevingoedecke.com\/#\/schema\/person\/4b156cd6453e1af4bab9076b0a663871","name":"Kevin Goedecke","url":"https:\/\/kevingoedecke.com\/blog\/author\/kgoedecke\/"}]}},"jetpack_featured_media_url":"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2017\/07\/woocommerce-logs-aws-beanstalk@2x.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/posts\/319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/comments?post=319"}],"version-history":[{"count":5,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/posts\/319\/revisions"}],"predecessor-version":[{"id":327,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/posts\/319\/revisions\/327"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/media\/320"}],"wp:attachment":[{"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/media?parent=319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/categories?post=319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/tags?post=319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}