nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Can lighttpd access log be filtered?

This is a discussion on Can lighttpd access log be filtered? within the Web servers forums, part of the Mastering Servers category; Hi, I'm running lighttpd 1.4.18 on an embedded Linux system with limited amount of disk space. Is there a way ...


Go Back   nixCraft Linux Forum > Mastering Servers > Web servers

Linux answers from nixCraft.


Web servers Discussion on Apache, Nginx and Lighttpd HTTP/web server and configuration issues.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 17-01-2008, 11:47 AM
Junior Member
User
 
Join Date: Jan 2008
Location: Finland
OS: Debian
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
petu is on a distinguished road
Default Can lighttpd access log be filtered?

Hi,

I'm running lighttpd 1.4.18 on an embedded Linux system with limited amount of disk space. Is there a way to filter or limit the amount of information that the accesslog module writes to the log file? Can I turn off logging of image files (.jpg) for example?

Any help would be appreciated.
Reply With Quote
  #2 (permalink)  
Old 17-01-2008, 03:21 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
OS: Debian GNU/Linux
Posts: 506
Thanks: 0
Thanked 8 Times in 6 Posts
Rep Power: 7
monk has a spectacular aura about monk has a spectacular aura about
Default

Try something as follows:

Assuming that images are in /path/to/webroot/images and html files are in
/path/to/webroot/html
Code:
$HTTP["url"] =~ "^/path/to/webroot/html($|/)"{
  accesslog.filename = "/var/log/lighttpd.log"
}
__________________
May the force with you!
Reply With Quote
  #3 (permalink)  
Old 18-01-2008, 10:59 AM
Junior Member
User
 
Join Date: Jan 2008
Location: Finland
OS: Debian
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
petu is on a distinguished road
Default

Hi Monk,

Thanks for your advice. It works like a charm . I'm filtering out the style sheets and images with the following:

Code:
$HTTP["url"] !~ "(\.css|\.jpg)$" {
  accesslog.filename = "/var/log/lighttpd.log"
}
Reply With Quote
  #4 (permalink)  
Old 21-10-2008, 03:31 AM
Junior Member
User
 
Join Date: May 2008
OS: Debian
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
mumuri is on a distinguished road
Default

does it optimise performance of the webserver?
Reply With Quote
  #5 (permalink)  
Old 21-10-2008, 07:20 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,709
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Yes, it should improve performance.
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #6 (permalink)  
Old 21-10-2008, 01:10 PM
Junior Member
User
 
Join Date: May 2008
OS: Debian
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
mumuri is on a distinguished road
Default

i ve done some test with ab, this doesn't seems to be the case

thanks anyway

at least, it's help awstats (or any log analyzer) to finish their work sooner
Reply With Quote
Reply

Tags
lighttpd , performance , webserver


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
lighttpd ProxyPass thunderbirdsei Web servers 0 30-04-2008 10:50 PM
Inactivity timer for lighttpd petu Web servers 0 11-03-2008 12:49 PM
Apache and lighttpd together anjanesh Web servers 4 29-08-2007 05:11 PM
redirect to www in lighttpd muks Web servers 11 02-06-2007 10:55 PM
Debian recovery mode read only access make it write access Donavit Linux software 1 30-12-2005 12:49 AM


All times are GMT +5.5. The time now is 02:14 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38