Command Check Error Logs Linux
Contents |
2014 in Commands, File system, LinuxI am a new Linux user. I how to check php error logs in linux would like to know where are the log files how to check apache error logs in linux located under Debian/Ubuntu or CentOS/RHEL/Fedora Linux server? How do I open or view log how to check logs in linux server files on Linux operating systems? Almost all logfiles are located under /var/log directory and its sub-directories on Linux. You can change to this directory
Linux Service Log
using the cd command. You need be the root user to view or access log files on Linux or Unix like operating systems. You can use the following commands to see the log files:less commandmore commandcat commandgrep commandtail commandzcat commandzgrep commandzmore commandHow do I view log files how to view logs in linux command line on Linux?Open the Terminal or login as root user using ssh command. Go to /var/log directory using the following cd command: # cd /var/log
To list files use the following ls command: # ls Sample outputs from RHEL 6.x server:anaconda.ifcfg.log boot.log-20111225 cron-20131110.gz maillog-20111218 messages-20131103.gz secure-20131027.gz spooler-20131117.gz up2date-20131117.gz anaconda.log btmp cron-20131117.gz maillog-20111225 messages-20131110.gz secure-20131103.gz squid uptrack.log anaconda.program.log btmp-20120101 cups maillog-20120101 messages-20131117.gz secure-20131110.gz swinstall.d uptrack.log.1 anaconda.storage.log btmp-20131101.gz dkms_autoinstaller maillog-20131027.gz mysqld.log secure-20131117.gz tallylog uptrack.log.2 anaconda.syslog collectl dmesg maillog-20131103.gz ntpstats setroubleshoot UcliEvt.log varnish anaconda.yum.log ConsoleKit dmesg.old maillog-20131110.gz prelink spooler up2date wtmp arcconfig.xml cron dracut.log maillog-20131117.gz rhsm spooler-20111211 up2date-20111211 yum.log atop cron-20111211 dracut.log-20120101 messages sa spooler-20111218 up2date-20111218 yum.log-20120101 audit cron-20111218 dracut.log-20130101.gz messages-20111211 secure spooler-20111225 up2date-20111225 yum.log-20130101.gz boot.log cron-20111225 httpd messages-20111218 secure-20111211 spooler-20120101 up2date-20120101 boot.log-20111204 cron-20120101 lastlog messages-20111225 secure-20111218 spooler-20131027.gz up2date-20131027.gz boot.log-20111211 cron-20131027.gz maillog messages-20120101 secure-20111225 spooler-20131103.gz up2date-20131103.gz boot.log-20111218 cron-20131103.gz maillog-20111211 messages-20131027.gz secure-20120101 spooler-20131110.gz up2date-201311that make it easy to view logfiles. The most important command is "tail". Tail can be used to read the last lines from a file. Examples: Get the last 100 lines from linux /var/log/messages the Debian mail log file: tail -n 100 /var/log/mail.log To get all newly added
Linux Log Files Explained
lines from a log file in realtime on the shell, use the command: tail -f /var/log/mail.log to quit tail and go
Linux Log Command
back to the commanline press the keys [ctrl] + [c] If you want to get the last 1000 lines from a log file and they do not fit into your shell window, you can use http://www.cyberciti.biz/faq/linux-log-files-location-and-how-do-i-view-logs-files/ the command "more" to be able to view them line by line. tail -n 1000 /var/log/mail.log | more press [space] to go to the next line or [ctrl] + [c] to quit. If you want to search for a specific term in a large file, the command "grep" comes in handy. Example: We search for the email address "[emailprotected]" in the mail log file: grep "[emailprotected]" /var/log/mail.log If you want to http://www.faqforge.com/linux/distributions/debian/linux-how-to-view-log-files-on-the-shell/ view the whole content of file on the shell, use the command "cat". Example: cat /proc/cpuinfo will show you detailed info about the CPU of your computer. Till Basics, Debian, Ubuntu No Comments ← Where is the ISPConfig roadmap? Linux: Get detailed information about server hardware and partitions on the shell → Leave a Reply Cancel reply Your email address will not be published. Required fields are marked *Comment Name * Email * Website CAPTCHA-Code Search Categories Basics CentOS Controlpanels Debian Distributions Email FTP iPad & iPhone ISPConfig 2 ISPConfig 3 Linux & Unix Mac OS X MySQL PostgreSQL Programming Server Ubuntu Uncategorized Virtualisation Vista Webserver Windows Windows 10 Windows 7 Windows 8 XP Tags7 apache boot change consumer Debian default delete desktop disable error files Firefox install ISPConfig 2 ISPConfig 3 key Linux & Unix Linux & Unix manager menu metro mint MySQL OpenVZ password postfix powershell preview registry remove screen script search Shell startup system Thunderbird Ubuntu virtualbox Vista Windows Windows 7 Windows 8 XP Pages Imprint Copyright © 2016 FAQforge. Powered by WordPress. Theme: Spacious by ThemeGrill. We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok
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 https://www.digitalocean.com/community/tutorials/how-to-view-and-configure-linux-logs-on-ubuntu-and-centos 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 https://access.redhat.com/documentation/en-US/Red_Hat_Directory_Server/8.1/html/Using_the_Admin_Server/Administration_Server_Basics-Logging_Options.html 161.2k 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 how to 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 logs in linux 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
of IP AddressesNext2.4. Viewing Logs Log files monitor activity for Admin Server and can help troubleshoot server problems. Admin Server logs use the Common Logfile Format, a broadly supported format that provides information about the server. Admin Server generates two kinds of logs: Access logs. Access logs show requests to and responses from the Admin Server. By default, the file is located at /var/log/dirsrv/admin-serv/access. Error logs. Error logs show messages for errors which the server has encountered since the log file was created. It also contains informational messages about the server, such as when the server was started and who tried unsuccessfully to log on to the server. By default, the file is located at /var/log/dirsrv/admin-serv/error. The logs can be viewed through Admin Server Console or by opening the log file. 2.4.1. Viewing the Logs through the Console Open the Admin Server management window. Click the Configuration tab. Expand the Logs directory, and click the log file name, either Accesses or Error. 2.4.2. Viewing Logs in the Command Line The access log, by default, is at /var/log/dirsrv/admin-serv/access. To view the access log, open it in an editor such as vi. Access logs show connections to the Admin Server based on the IP address of the client, the username, and the method that the request was sent. Each line has the following format: ip_address - bind_DN [timestamp -0500] "GET|POST cgi" HTTP_response bytes Example logs are shown in Example 2.1, “Example Access Logs”. Example 2.1. Example Access Logs127.0.0.1 - cn=directory manager [23/Dec/2008:19:32:52 -0500] "GET /admin-serv/authenticate HTTP/1.0" 200 338 192.168.123.121 - cn=directory manager [23/Dec/2008:19:33:14 -0500] "POST /admin-serv/tasks/Configuration/ServerSetup HTTP/1.0" 200 244 192.168.123.121 - cn=directory manager [23/Dec/2008:19:33:16 -0500] "GET /admin-serv/tasks/Configuration/ReadLog?op=count&name=