nixCraft Linux Forum

nixCraft

Linux 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

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 01-17-2008, 11:47 AM
Junior Member
User
 
Join Date: Jan 2008
Location: Finland
My distro: Debian
Posts: 3
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
Sponsored Links
  #2 (permalink)  
Old 01-17-2008, 03:21 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 481
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
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 01-18-2008, 10:59 AM
Junior Member
User
 
Join Date: Jan 2008
Location: Finland
My distro: Debian
Posts: 3
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
Reply

Bookmarks


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 On

Similar Threads

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


All times are GMT +5.5. The time now is 08:11 AM.


Powered by vBulletin® Version 3.7.2 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

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