How to clear the access log safely?

1,123 views
Skip to first unread message

PISoft Builder [CVSH]

unread,
Jan 11, 2006, 11:16:28 PM1/11/06
to sign up to POUG.uraniid.net - Philippine OpenBSD Users Group
Finally, we change the ip address of our workstations. Ofcourse we need
to clear access.log file. Last night I tried to clear this log file,
but error message appeared.

Please tell me how to clear access.log file safely...

Thanks.

robust

unread,
Jan 11, 2006, 11:31:01 PM1/11/06
to sign up to POUG.uraniid.net - Philippine OpenBSD Users Group
Specify what kind of logfile how did u clear it and is this
obsd machines? I can answer if its freebsd too =). see u
later iislep nako i need to goto work tomorow. I will
ans na lang ur westion tom ala ung mga ibang moderator
so ako lang nagmamanage ng mga posts here =).

PISoft Builder [CVSH]

unread,
Jan 11, 2006, 11:39:54 PM1/11/06
to sign up to POUG.uraniid.net - Philippine OpenBSD Users Group
Yea OpenBSD

/usr/local/squid/var/logs/access.log <----- log file

Do I need to delete this file
---------------
rm access.log

vi access.log
---------------
then save?

robust

unread,
Jan 11, 2006, 11:47:21 PM1/11/06
to sign up to POUG.uraniid.net - Philippine OpenBSD Users Group
Deleteing access.log is ok as long as u create a new empty
one rm access.log && touch access.log && /usr/local/squid \
/squid -k reconfigure.

robust

unread,
Jan 12, 2006, 10:34:19 AM1/12/06
to sign up to POUG.uraniid.net - Philippine OpenBSD Users Group
Be sure to set the owner and the group _squid _squid
for the access.log.

Joseph Tacuyan

unread,
Jan 12, 2006, 7:47:26 PM1/12/06
to po...@googlegroups.com
hi,

  i can't get the point why you have to clear the logfile of your squid, did u configure your squid to rotate the logfiles? on that way it will automatically delete the old ones.
You can see these files if u enable the logrotate option;

access.log
access.log.X
access.log.XX
  on your log directory.

However u f u still want to empty the logfile.
do this;

cat /dev/null > /path/to/log/access.log

viola!

regards.

/tuxz

PISoft Builder [CVSH]

unread,
Jan 12, 2006, 9:57:54 PM1/12/06
to sign up to POUG.uraniid.net - Philippine OpenBSD Users Group
Thanks for that command :).

PISoft Builder [CVSH]

unread,
Jan 13, 2006, 1:38:38 AM1/13/06
to sign up to POUG.uraniid.net - Philippine OpenBSD Users Group
hello!

i need log analyzer.

we need to view access.log with date/time the sort it by ip address/web
site/user.

please give me a copy of PHP Script access.log analyzer. (we want php
script) anybody knows any link about it?

thanks.

ramehr bayac

unread,
Jan 13, 2006, 4:36:01 AM1/13/06
to sign up to POUG.uraniid.net - Philippine OpenBSD Users Group
squid website has good list of scripts for log analysis just choose
best that suits your need.

Reply all
Reply to author
Forward
0 new messages