7

Viewing your access and error logs via SFTP

 3 years ago
source link: https://help.dreamhost.com/hc/en-us/articles/216512197-Viewing-your-access-and-error-logs-via-SFTP
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Viewing your access and error logs via SFTP

Overview

For troubleshooting purposes, you may sometimes need to check your site’s error logs and access logs to get more information as to why a problem may occur. This article explains how to view these logs using SFTP.

If you'd like to view and examine these files via SSH, view the following articles instead:

  • Logs are rotated every night so that access.log and error.log only contain today’s logs, while error.log.0 and access.log.0 contain logs from the day before.
  • Log files are deleted shortly after this, so it’s recommended to check them as soon as possible.
  • Per GDPR, DreamHost stores HTTP logs by default for 3 days.

Viewing the logs via SFTP

dh-kb-important-icon.svg

It is not possible to view your logs using the file manager in the panel.

You must use a fully functional FTP client such as Filezilla or Cyberduck to view your logs.

As mentioned previously, the logs are inside the /logs/example.com/http(s) directory under your username on the server.

To view the logs:

  1. Make sure your user is an SFTP or Shell user. Visit the Creating a user with Shell (SSH) access article for instructions.
  2. Log into your server using your client. Visit the FTP article for details. Once logged in, you’ll see several files; in this example we’re in the exampleuser’s directory noted by the Remote site: field which shows /home/exampleuser: 01 Error Log.fw.png
  3. Click into the /logs directory. You then see a list of sites associated with this user: 02 Error Log.fw.png
  4. Click into the appropriate site from this next directory. 03 Error Log.fw.png
  5. Click into the http or https directory depending on which logs you'd like to view.

    Your http or https directory may have a random string of numbers after it, or you may see several directories. Just look at the date to the right to choose the most recent directory.

    You’ll see the error.log and access.log as of today. 04 Error Log.fw.png

    Once in the /http directory, you'll notice that your remote site looks different at the top, which shows that your selected directories have changed – this is fine.

  6. Right click on the log file and open with your text editing program.

See also

Did this article answer your questions?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK