Read Error Logs Linux
Contents |
Introduction Target Audience System Logs Authorization Log Daemon Log Debug Log Kernel Log Kernel Ring Buffer System Log Application Logs Apache HTTP Server Logs CUPS Print System Logs Rootkit Hunter Log Samba SMB Server how to check logs in linux server Logs X11 Server Log Non-Human-Readable Logs Login Failures Log Last Logins Log
How To View Logs In Linux Command Line
Login Records Log System Logging Daemon (syslogd) Configuration of syslogd Echoing Messages to syslogd With Logger Log Rotation Essential linux log files explained Commands Getting Started Editing Files Viewing Files Viewing the Beginning of Files Viewing the End of Files Watching a Changing File Searching Files Resources Local System Resources WWW Resources Introduction One of linux /var/log/messages the things which makes GNU/Linux a great operating system is that virtually anything and everything happening on and to the system may be logged in some manner. This information is invaluable for using the system in an informed manner, and should be one of the first resources you use to trouble-shoot system and application issues. The logs can tell you almost anything you need
Linux Log Command
to know, as long as you have an idea where to look first. Your Ubuntu system provides vital information using various system log files. These log files are typically plain ASCII text in a standard log file format, and most of them sit in the traditional system log subdirectory /var/log. Many are generated by the system log daemon, syslogd on behalf of the system and certain applications, while some applications generate their own logs by writing directly to files in /var/log. This guide talks about how to read and use several of these system log files, how to use and configure the system logging daemon, syslogd, and how log rotation works. See the Resources section for additional information. Target Audience This guide will be simple enough to use if you have any experience using the console and editing text files using a text editor. See the end of this document for some essential commands that may help you find your way around these files if you're relatively new to the command line. System Logs System logs deal primarily with the functioning of the Ubuntu system, not necessarily with additiona
know where the log files are located, and what is contained in each and every log file. When your systems are running smoothly, take some how to check log files in unix time to learn and understand the content of various log files, which will help /var/log/syslog you when there is a crisis and you have to look though the log files to identify the issue. /etc/rsyslog.conf
How To Check Logs In Putty
controls what goes inside some of the log files. For example, following is the entry in rsyslog.conf for /var/log/messages. $ grep "/var/log/messages" /etc/rsyslog.conf *.info;mail.none;authpriv.none;cron.none /var/log/messages In the above output, *.info indicates that all https://help.ubuntu.com/community/LinuxLogFiles logs with type INFO will be logged. mail.none,authpriv.none,cron.none indicates that those error messages should not be logged into the /var/log/messages file. You can also specify *.none, which indicates that none of the log messages will be logged. The following are the 20 different log files that are located under /var/log/ directory. Some of these log files are distribution specific. For example, you'll see dpkg.log on Debian http://www.thegeekstuff.com/2011/08/linux-var-log-files based systems (for example, on Ubuntu). /var/log/messages - Contains global system messages, including the messages that are logged during system startup. There are several things that are logged in /var/log/messages including mail, cron, daemon, kern, auth, etc. /var/log/dmesg - Contains kernel ring buffer information. When the system boots up, it prints number of messages on the screen that displays information about the hardware devices that the kernel detects during boot process. These messages are available in kernel ring buffer and whenever the new message comes the old message gets overwritten. You can also view the content of this file using the dmesg command. /var/log/auth.log - Contains system authorization information, including user logins and authentication machinsm that were used. /var/log/boot.log - Contains information that are logged when the system boots /var/log/daemon.log - Contains information logged by the various background daemons that runs on the system /var/log/dpkg.log - Contains information that are logged when a package is installed or removed using dpkg command /var/log/kern.log - Contains information logged by the kernel. Helpful for you to troubleshoot a custom-built kernel. /var/log/lastlog - Displays the recent login information for all the users. This is not an ascii file. You should use last
and Logs Linux maintains several system logs that help you administer a Linux system by informing you of important events. Probably http://www.oreilly.com/openbook/debian/book/ch07_04.html the most important log is the file /var/log/messages, which records a https://www.digitalocean.com/community/tutorials/how-to-view-and-configure-linux-logs-on-ubuntu-and-centos variety of events, including system error messages, system startups, and system shutdowns. Like most other Linux files, the file contains ASCII text, so you can view it with a text editor or the text processing commands described in Chapter 13. A special command, how to dmesg, makes it easy to view the log messages related to the most recent system startup. If your system is behaving unusually, use dmesg to quickly see if something went wrong during the system startup sequence. Of course, you must have some way of determining what's usual and unusual among the many messages emitted during how to check system startup. The best way to do so is to print the output of the dmesg command and keep it on hand for comparison with suspicious output. If your system has an attached printer, you can print the output of dmesg by entering the following command: dmesg | lpr Other logs found in the /var/log directory include: apache A directory that contains two log files pertaining to the Apache web server, access.log and error.log. exim A directory that contains several log files pertaining to the exim mail transfer agent. nmb and smb Files that contain log entries pertaining to Samba, the Microsoft-compatible networking server. ppp.log A file the contains log entries pertaining to PPP. 7.3 Starting and Stopping the System and Services 7.5 Setting the System Time and Time Zone Back to: Learning Debian GNU/Linux oreilly.com Home | O'Reilly Bookstores | How to Order | O'Reilly Contacts International | About O'Reilly | Affiliated Companies | Privacy Policy © 2001, O'Reilly & Associates, Inc.
In submit Tutorials Questions Projects Meetups Main Site logo-horizontal DigitalOcean Community Menu Tutorials Questions Projects Meetups Main Site Sign Up Log In submit View All Results By: Sadequl Hussain Subscribe Subscribed Share Contents Contents We hope you find this tutorial helpful. In addition to guides like this one, we provide simple cloud infrastructure for developers. Learn more → 9 How To View and Configure Linux Logs on Ubuntu and Centos Posted Dec 17, 2013 168.1k views Logging Linux Basics CentOS Ubuntu Debian Introduction Linux system administrators often need to look at log files for troubleshooting purposes. In fact, this is the first thing any sysadmin would do. Linux and the applications that run on it can generate all different types of messages, which are recorded in various log files. Linux uses a set of configuration files, directories, programs, commands and daemons to create, store and recycle these log messages. Knowing where the system keeps its log files and how to make use of related commands can therefore help save valuable time during troubleshooting. In this tutorial, we will have a look at different parts of the Linux logging mechanism. Disclaimer The commands in this tutorial were tested in plain vanilla installations of CentOS 6.4, Ubuntu 12 and Debian 7. Default Log File Location The default location for log files in Linux is /var/log. You can view the list of log files in this directory with a simple ls -l /var/log command. This is what I see in my CentOS system: [root@TestLinux ~]# ls -l /var/log total 1472 -rw-------. 1 root root 4524 Nov 15 16:04 anaconda.ifcfg.log -rw-------. 1 root root 59041 Nov 15 16:04 anaconda.log -rw-------. 1 root root 42763 Nov 15 16:04 anaconda.program.log -rw-------. 1 root root 299910 Nov 15 16:04 anaconda.storage.log -rw-------. 1 root root 40669 Nov 15 16:04 anaconda.syslog -rw-------. 1 root root 57061 Nov 15 16:04 anaconda.xlog -rw-------. 1 root root 1829 Nov 15 16:04 anaconda.yum.log drwxr-x---. 2 root root 4096 Nov 15 16:11 audit -rw-r--r-- 1 root root 2252 Dec 9 10:27 boot.log -rw------- 1 root utmp 384 Dec 9 10:31 btmp -rw-------. 1 root utmp 1920 Nov 28 09:28 btmp-20131202 drwxr-xr-x 2 root root 4096 Nov 29 15:47 ConsoleKit -rw------- 1 root root 2288 Dec 9 11:01 cron -rw-------. 1 root root 8809 Dec 2 17:09 cron-20131202 -rw-r--r-- 1 root root 21510 Dec 9 10:27 dmesg -rw-r--r-- 1 root root 21351 Dec 6 16:37 dmesg.old -rw-r--r--. 1 root root 16