Squid Proxy Sever View logs / log files
Q. How do I view squid proxy server log files under CentOS Linux server 5.0?
A. squid is a high-performance proxy caching server for web clients, supporting FTP, gopher, and HTTP data objects. Unlike traditional caching software, squid handles all requests in a single, non-blocking, I/O-driven process.
/var/log/squid/ log file directory
The logs are a valuable source of information about Squid workloads and performance. The logs record not only access information, but also system configuration errors and resource consumption (eg, memory, disk space). There are several log file maintained by Squid. Some have to be explicitely activated during compile time, others can safely be deactivated during.
- /var/log/squid/access.log : Most log file analysis program are based on the entries in access.log. You can use this file to find out who is using squid server and what they are doing etc
- /var/log/squid/cache.log : The cache.log file contains the debug and error messages that Squid generates. If you start your Squid using the default RunCache script, or start it with the -s command line option, a copy of certain messages will go into your syslog facilities. It is a matter of personal preferences to use a separate file for the squid log data.
- /var/log/squid/store.log : The store.log file covers the objects currently kept on disk or removed ones. As a kind of transaction log it is ususally used for debugging purposes. A definitive statement, whether an object resides on your disks is only possible after analysing the complete log file. The release (deletion) of an object may be logged at a later time than the swap out (save to disk).
How do I view Squid Log files / logs?
You can use standard UNIX / Linux command such as grep / tail to view log files. You must login as root or sudo command to view log files.
Display log files in real time
Use tail command as follows:
# tail -f /var/log/squid/access.log
OR
$ sudo tail -f /var/log/squid/access.log
Search log files
Use grep command as follows:
grep 'string-to-search' /var/log/squid/access.log
View log files
Finally you can use text editor such as vi to view log files:
# vi /var/log/squid/access.log
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Linux / UNIX FAQ:
- Squid Proxy Server Mac Address based filtering
- How to: Linux / UNIX setup Squid Proxy authentication
- Squid proxy authentication in transparent mode
- Squid proxy How to filter or block a particular port
- Squid content filtering: Block / download of music MP3, mpg, mpeg, exec files
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!
Tags: access_log, cache, caching_software, grep_command, linux_command, server_log_files, squid_log, squid_proxy_server, squid_server, sudo_command, tail_command, view_squid_log ~ Last updated on: September 24, 2007



October 17th, 2007 at 1:56 pm
this rokes
January 10th, 2008 at 8:39 pm
When squid is running if a log file is opened using vi, will it lock the file and cause problem with squid?
January 11th, 2008 at 2:34 am
WebTenet,
Noop, it will keep log in the message
April 28th, 2008 (3 weeks ago) at 6:56 am
hi ,
i m a new squid user, i m getting all d loged in information of users through psacct services n various commands, but what i m really searching 4 is the particular users downloaded dat information while using services of internet via SQUID server, please help me out with dis .
thanking in advance
Pradeep Singh
http://www.excelsoftware.net