httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Kalu┼ża <>
Subject [PATCH] Make error logging modular
Date Mon, 27 May 2013 10:23:54 GMT

last week I was trying to write my own module to log error_log to 
systemd-journal [1] and I've found out that with the current error_log 
code, it's not possible to do that properly.

I was able to use "error_log" hook, but there is no way to disable 
creation of "ErrorLog" file (One can set it to "/dev/null", but httpd 
will still write data to it without any reason). Syslog logger fixes 
that by hardcoding syslog methods in log.c/core.c, but I don't think 
that's the right thing to do with journald.

Therefore, I've created following patches:

Their descriptions should be clear from their names, but I will describe 
them briefly here too.

Patch 0001 declares ap_errorlog_provider which can be implemented by 
module providing error_log logger. Admin can later define "ErrorLog 
provider arg" to choose particular errorlog provider. Old syntax still 
works and the change is backward compatible. This patch also removes 
syslog logging from log.c (it is moved to newly created mod_syslog.c in 
next patch)

Patch 0002 creates mod_syslog.c which uses the new API to implement 
syslog logging. It works the same way as the version in log.c I removed 
in previous patch, but it's in separate module.

Patch 0003 shows how mod_journald.c can use the existing API. This 
module works well with systemd-journal, but unfortunately the 
performance of systemd-journal daemon is poor so far [2], but I presume 
it will be fixed and the module will be usable for general use in the 
future. There is probably no real benefit in accepting this last patch 
right now. It's here to only show why the previous two patches are useful.

Note that this is my first bigger patch touching httpd core, so feel 
free to correct my possible mistakes... :)


Jan Kaluza

View raw message