[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#714613: ap_log_perror ignores LogLevel configuration directives



Hi,

On 01/07/13 12:52, Stefan Fritsch wrote:
> On Monday 01 July 2013, Matthew Vernon wrote:

>> void *merge_dir_config(apr_pool_t *p, void* base, void *new)
>>
>> so the only logging function you can use is ap_log_perror.
> 
> Since the server config does not yet exist at this stage, that is 
> correct.

Indeed, although such functions are called later once the server is up
and running, too; I think calling ap_get_module_config will merge
configurations.

>> ....which means that however you configure LogLevel, ap_log_perror
>> won't result in anything being logged unless you set the level to
>> <= ap_default_loglevel (which is APLOG_WARNING).
>>
>> Since this is the only way to log the behaviour of config-merging
>> code (which you'd naturally want to log at DEBUG or similar), I
>> think this is a bug.
> 
> You can set ap_default_loglevel with the -e command line option. I 
> guess this could be documented better. But to debug stuff 
> before/during the first config parsing, this is is all you get.
> 
> There is also the possibility to use ap_log_error() with 
> ap_server_conf as server_rec. But IIRC, this is not safe in 2.2, 
> though. Maybe the behavior of ap_log_perror() can be improved to use 
> the main server's loglevel after the config has been created, though. 
> I will look at it when I have some time.

That would seem to me to be the right answer :)

Cheers,

Matthew


Reply to: