How do I read my logs ?

I know you can do /var/logs but I don’t know what to do, how do I read the files, because my website is refusing to connect even though I have dns and everything else configured correctly so how do I view my logs as it could be the droplet rejecting my request?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

To view the last entries of your logs you can use the tail command.

So for example, if you have an Apache service you can view the last 100 lines of the Apache error log with the following command:

tail -100 /var/log/apache2/error.log

You can also use the ls command to view all of the log files inside the /var/log folder:

ls -l /var/log

Then you can choose which log file exactly you would like to check.

Hope that this helps. Regards, Bobby