Logs Records in Linux | What are they? | How to use them?


What are logs ??


Linux logs provide a timeline of events for the Linux OS as well as the applications running inside the system, and are a valuable troubleshooting tool whilst you come across issues. Essentially, studying log documents is the first aspect an administrator desires to do whilst an problem is discovered.

Basically, the log records are kept or stored in a file as plain-text which can be found inside the system, more specifically at /var/log directory.

VARIOUS LOG RECORDS / FILES


  • /var/log/messages : contains logs of DNS, DHCP, NIS, LDAP services

  • /var/log/secure : Contains logs of local login, ssh, telnet..

  • /var/log/maillog : Contains logs of mail services

  • /var/log/dmeg : Contains hardware (kernel) related logs

  • /var/log/httpd/* : Contains logs of web services

  • /var/log/samba/* : Contains logs of samba service

  • /var/log/cron : Contains logs of cron service

  • /var/log/yum.log : Contains yum logs


FORMAT OF LOG FILES


<D/T> <Hostname> <Process Name> [PID] : <message>

D/T : Represents date and time of log generation

Hostname : Represents name of the host that generated the log message

Process Name : Represents name of the service or app that generated the log

PID : Represents ID of the process that generated the log

Message : Represents the log message itself




Post a Comment

0 Comments