Question

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

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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