Where are the log files (logs) in Linux

Some months ago saw that the log files (logs) are very useful when it comes to detect faults and try fix them. They especially serve to receive help in forums and blogs.This time, we are going to see where the log files traditional common and what information they contain.


The best practice is to navigate to the / var / log folder and list the files contained within that folder. All available log files will appear. Their names are self-explanatory.

cd / var / log ls

Common log files (may vary by distro):

Related article:
Repair sectors and recover a hard disk (HDD) in Linux
  • / var / log / message: general system message log
  • /var/log/auth.log: authentication log
  • /var/log/kern.log: kernel log
  • /var/log/cron.log: crond log
  • / var / log / maillog: mail server log
  • / var / log / qmail /: Qmail log
  • / var / log / httpd /: Apache access and error log
  • / var / log / lighttpd: Lighttpd access and error log
  • /var/log/boot.log: system boot log
  • /var/log/mysqld.log - MySQL database log
  • / var / log / secure: authentication log
  • / var / log / utmp or / var / log / wtmp: log log

Conclusion, in / var / log all the system logs are stored. However, some applications like httpd include a subdirectory in there where they store their own log files.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   karlos sanchez said

    This has helped me determine where the heck was the extra 3gb that the disk occupied ..

    Greeting!! Excellent blog

  2.   Let's use Linux said

    Yes, but that depends on how each program saves its logs ... it would be necessary to explain them one by one in an endless and boring article. For this there are the man pages ... or the forums.

    The idea of ​​this article is to introduce the topic so that people remember the existence of logs and that they know that they contain valuable information to help us solve problems. Also, as seen in this article ( http://usemoslinux.blogspot.com/2011_11_01_archive.html), when one has to ask for help in the forums, it is always better if the log files are included. There are others who will help us understand what these logs say…. The important thing is that but to ask for help before you have to know how to ask for it and what information to provide to those who can help us!
    Cheers! Paul.

  3.   cerberus said

    Yes, but the screwed up is not knowing where the logs are, the screwed up is knowing how to read them ...

    1.    goluk said

      Completely according to zerberros. The article is good but I would have liked them to explain each of the logs.

  4.   Francisco said

    I have this problem
    Error getting information for file "/var/log/mail.log": File or directory does not exist
    I can do?

    1.    pepper said

      create it

      1.    Edson Ortiz said

        How is it created?

  5.   frank said

    I recently installed Linux Mint 17 Cinnamon 64bits, and there are certain errors that I would like to fix such as:
    when I lock my session and I will do something else ... when I return to unlock the screen
    The only thing I can do is move the mouse .... I have to restart to re-enter normal ... someone else has happened to him ... Could someone help me ???

    1.    x11tete11x said
  6.   frank said

    Good blog, I have already read many posts and they are good

    1.    Rodrigo said

      Check the same http://www.forosdelweb.com/f41/ : )

  7.   HN said

    Also quite important are the e-mail log files, for example Exim, where we can see all the incoming and outgoing e-mail logs on our server.

    We can use the tail command, to see the log in real time with the tail command.

    tail -n 200 -f / var / log / exim_mainlog
    tail -n 200 -f / var / log / exim_paniclog
    tail -n 200 -f / var / log / maillog

    If you have any improved command to check logs I would appreciate it.

    regards

    1.    pepper said

      In my opinion, the use of the command is not bad at all, but I use it in a different way (to taste the colors), I add at the end a "grep" to be able to filter by error, fail or whatever you need to look at, also If you write something new that matches the filter, it shows you on the screen:
      tail -150f /var/log/file.log | grep -i -E 'error | fail'

  8.   Natalia said

    Hello in my positive BGH lately I appeared things of fail when restarting. And now when I turn it on it flickers and does not start but says things and something about The Apache error log may have more information. * starting web server apache2 [fail]

    Can you tell me how to solve this? Thanks

    1.    pepper said

      You will know what BGH means, I have no idea ... although I can think of a thousand meanings significa
      Regarding Apache, the problem is when starting Apache, you should look at the logs of said application to know what the problem is.

  9.   Martin said

    I need to uninstall jdonloader and it asks me to delete the log files, but how do I look for them in which folder I would have to go? Thank you, I hope for answers.

    1.    pepper said

      In the jdownloader configuration you can see where it saves the logs and if it does, once this is done you can eliminate the program folder completely in order to avoid problems.

  10.   claudia said

    Please someone knows where to find information about what happens if my memory is full and because of that an application crashes or fails, as far as I know that once it fails you get a message: "memory full", and when that happens a file behind. How to find it, to understand it?

    1.    pepper said

      check the space with a df, so you will know that fs is filling up, anyway if you know the process or the application or service that is generating or attacking the file you indicate you could look at the various commands and find where it writes and if it has I use a certain process or several ... anyway you can look at the ram memory space with the free command

  11.   Web domain said

    Don't miss PymeDay this June 8-9 and 10
    https://www.dominioweb.net

  12.   host.cl said
  13.   HN Datacenter Chile said

    Excellent 🙂

    https://www.hn.cl

  14.   wolfson48 said

    Fine, thanks.
    I have already located the /var/log/ directory. Now I need to know how to read the error files and how to fix them.
    When I try to open the file, it tells me that I don't have permissions, despite logging in as root when doing so after the su command.
    Can anyone offer me a solution?
    Thank you.