0

I have my webserver configured with lighttpd/1.4.31.

About 80% of all entries in lighttpd's

/var/log/lighttpd/access.log
consist of my own ip address.

I would like to disable my ip address logging access entries to access.log.

How can I achieve this?

kzpm
  • 69
  • 1
  • 8
  • To clarify the question: You want to exclude all log entries including a certain IP address (e.g. yours)? First question: Why? Thats the task of logs: write everything that happens. For evaluations, it makes more sense to exclude certain IPs. – sebix Jun 09 '15 at 07:18
  • @sebix: Yes I want to disable logging my own ip address, because it makes analyzing logs more simple I think. – kzpm Jun 10 '15 at 13:28
  • An easier way to not print log lines containing certain words is `grep -v '' ` – mzhaase Nov 22 '16 at 14:19

1 Answers1

1

After enabling the accesslog-module using lighty-enable-mod accesslog, modify conf-enabled/10-accesslog.conf as follows:

server.modules += ( "mod_accesslog" )
accesslog.filename = "/var/log/lighttpd/access.log"
$HTTP["remoteip"] == "127.0.0.1" {
    accesslog.filename = "/dev/null"
}

Bryce Guinta
  • 183
  • 1
  • 5
sebix
  • 4,175
  • 2
  • 25
  • 45