{"id":16508,"date":"2022-02-04T11:46:40","date_gmt":"2022-02-04T10:46:40","guid":{"rendered":"https:\/\/www.oderland.se\/support\/artikel\/hur-nar-jag-atkomstloggar-for-mina-hemsidor\/"},"modified":"2023-05-15T08:59:00","modified_gmt":"2023-05-15T07:59:00","slug":"where-can-i-find-access-logs-for-my-websites","status":"publish","type":"ht_kb","link":"https:\/\/www.oderland.se\/support\/en\/artikel\/where-can-i-find-access-logs-for-my-websites\/","title":{"rendered":"Where can I find access logs for my websites?"},"content":{"rendered":"\n<p>When troubleshooting, sometimes the access logs created by the server based on traffic towards a certain website may be handy. This guide will show you a few different ways to reach those logs, and will also tell you how to activate archiving of logs so you can access them for a longer period of time.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"komma-at-loggar\">Accessing the logs<\/h2>\n\n\n\n<p>You may access your logs by two different means; either via cPanel for the web hosting account, or via SSH.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"via-cpanel\">Via cPanel<\/h3>\n\n\n\n<p>To access the logs via cPanel, follow these steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Begin by <a rel=\"noreferrer noopener\" href=\"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-login-to-cpanel\/\" data-type=\"ht_kb\" data-id=\"4236\" target=\"_blank\">logging on to cPanel<\/a>.<\/li>\n\n\n\n<li>Click the icon <code>Raw Access<\/code> under <code>Metrics<\/code>.<br><a href=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_icon_raw_access-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"458\" height=\"198\" class=\"wp-image-18572\" style=\"width: 458px;\" src=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_icon_raw_access-1.png\" alt=\"\" srcset=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_icon_raw_access-1.png 458w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_icon_raw_access-1-300x130.png 300w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_icon_raw_access-1-50x22.png 50w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_icon_raw_access-1-60x26.png 60w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_icon_raw_access-1-100x43.png 100w\" sizes=\"auto, (max-width: 458px) 100vw, 458px\" \/><\/a><\/li>\n\n\n\n<li>If you scroll down a bit on the page, you&#8217;ll find a table containing the available logs. If you click the doman name in the <code>Domain<\/code> column, you will get to download a gz-compressed file containing the log.<br><a href=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_raw_access_table.png\"><img loading=\"lazy\" decoding=\"async\" width=\"807\" height=\"187\" class=\"wp-image-16514\" style=\"width: 807px;\" src=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_raw_access_table.png\" alt=\"\" srcset=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_raw_access_table.png 807w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_raw_access_table-300x70.png 300w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_raw_access_table-768x178.png 768w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_raw_access_table-50x12.png 50w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_raw_access_table-60x14.png 60w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_raw_access_table-100x23.png 100w\" sizes=\"auto, (max-width: 807px) 100vw, 807px\" \/><\/a><\/li>\n<\/ol>\n\n\n\n<p>In the table you&#8217;ll see the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Domain:<\/strong> Shows which domain the log file is for. Keep in mind that traffic towards http is logged separately from https. The latter is labelled with (SSL) next to the domain name.<\/li>\n\n\n\n<li><strong>Last Update:<\/strong> Timestamp of when the log file was last updated.<\/li>\n\n\n\n<li><strong>Disk Usage:<\/strong> How much disk space each log file uses. A large file means that there has been a lot of traffic going towards the domain.<\/li>\n\n\n\n<li><strong>Linked Domains:<\/strong> Here you see what addon domain that represents the domain visible in the <code>Domain<\/code> column.<\/li>\n<\/ul>\n\n\n\n<p>If you scroll further down on the page, you will see the header <code>Archived Raw Logs<\/code>. If archiving is activated (<a href=\"#activate-archiving-of-logs\">see below<\/a>), you will reach these older logs here.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"via-ssh\">Via SSH<\/h3>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-alert\">Please note that this method is intended for advanced users.<\/p>\n\n\n\n<p>To access your logs via SSH, begin by <a rel=\"noreferrer noopener\" href=\"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-connect-to-my-web-hosting-account-using-ssh\/\" data-type=\"ht_kb\" data-id=\"4832\" target=\"_blank\">connecting to the web hosting account via SSH<\/a>. Once connected, to to the folder <code>access-logs<\/code> available in the home directory of your account:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd ~\/access-logs<\/pre>\n\n\n\n<p>Here you will find the latest access logs for your account (the logs are rotated once per day, so the oldest data you may see is for the last 24 hours).<\/p>\n\n\n\n<p>If you have activated archiving of logs (<a href=\"#activate-archiving-of-logs\">see below<\/a>), you will find the log archive in the folder logs, available in the home directory of your account:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd ~\/logs<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"aktivera-arkivering-av-loggar\">Activate archiving of logs<\/h2>\n\n\n\n<p>Access logs are being rotated once per day, so if you want access to older logs than for the last 24 hours, you need to activate archiving of logs. To do this, follow these steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Begin by <a rel=\"noreferrer noopener\" href=\"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-login-to-cpanel\/\" data-type=\"ht_kb\" data-id=\"4236\" target=\"_blank\">logging on to cPanel<\/a>.<\/li>\n\n\n\n<li>Click the icon <code>Raw Access<\/code> under <code>Metrics<\/code>.<br><a href=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_icon_raw_access-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"458\" height=\"198\" class=\"wp-image-18572\" style=\"width: 458px;\" src=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_icon_raw_access-1.png\" alt=\"\" srcset=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_icon_raw_access-1.png 458w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_icon_raw_access-1-300x130.png 300w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_icon_raw_access-1-50x22.png 50w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_icon_raw_access-1-60x26.png 60w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_icon_raw_access-1-100x43.png 100w\" sizes=\"auto, (max-width: 458px) 100vw, 458px\" \/><\/a><\/li>\n\n\n\n<li>Under <code>Configure Logs<\/code>, check the checkbox next to <code>Archive log files to your home directory after the system processes statistics. The system currently processes logs every 24 hours.<\/code>.<br><a href=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_raw_access_configure_logs.png\"><img loading=\"lazy\" decoding=\"async\" width=\"887\" height=\"148\" class=\"wp-image-16518\" style=\"width: 887px;\" src=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_raw_access_configure_logs.png\" alt=\"\" srcset=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_raw_access_configure_logs.png 887w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_raw_access_configure_logs-300x50.png 300w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_raw_access_configure_logs-768x128.png 768w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_raw_access_configure_logs-50x8.png 50w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_raw_access_configure_logs-60x10.png 60w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2022\/02\/cpanel_raw_access_configure_logs-100x17.png 100w\" sizes=\"auto, (max-width: 887px) 100vw, 887px\" \/><\/a><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\">If you want to save disk space on your web hosting account, also check the checkbox next to <code>Remove the previous month's archived logs from your home directory at the end of each month.<\/code>. You will then have access to the past month&#8217;s logs, but none older than that. Don&#8217;t check the checkbox if you want to save all logs.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\">\n<li>Don&#8217;t forget to click <code>Save<\/code> after adjusting the settings.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>When troubleshooting, sometimes the access logs created by the server based on traffic towards a certain website may be handy. This guide will show you a few different ways to reach those logs, and will also tell you how to activate archiving of logs so you can access them for&#8230;<\/p>\n","protected":false},"author":12,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"ht-kb-category":[214],"ht-kb-tag":[],"class_list":["post-16508","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-cpanel-whm"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb\/16508","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/comments?post=16508"}],"version-history":[{"count":21,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb\/16508\/revisions"}],"predecessor-version":[{"id":18574,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb\/16508\/revisions\/18574"}],"wp:attachment":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/media?parent=16508"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb-category?post=16508"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb-tag?post=16508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}