how to use ngx_log_debug during configuration of a core module

Manlio Perillo manlio.perillo at gmail.com
Wed Mar 24 17:56:34 MSK 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Maxim Dounin ha scritto:
> Hello!
> 
> On Wed, Mar 24, 2010 at 03:04:00PM +0100, Manlio Perillo wrote:
> 
>> I'm having some troubles at using ngx_log_debug during configuration of
>> a core module I'm writing.
>>
>> I want to output some log info in the init_conf callback function but:
>>
>> * If I use cycle->log, the error level is fixed and set to NGX_LOG_INFO,
>>   so debug info will never be logged
>> * If I use cycle->new_log, the error level is correctly set, but no info
>>   is logged to the file.
>>   If I set log destination to "stderr", info is correctly logged
>>
>>
>> Should I simply use ngx_log_error(NGX_LOG_INFO, cycle->log)?
> 
> Yes.
> 

Tried rigth now, and it does not work.

I have logged the log name and fd of cycle->log, and I have:
log->name: (null), log->fd: 3

The cycle->new_log, instead, have:
log->name: /usr/local/nginx/logs/error.log, log->fd: -1


It seems that the log object is not fully configured, when module init
callbacks are called.



Thanks  Manlio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkuqKCIACgkQscQJ24LbaUQBMACgiV0HWPyGGPJsfWEBmXLWggXs
mxoAn1xDn9a7mw2agZuEfZd5O2O0DEdh
=Umbr
-----END PGP SIGNATURE-----



More information about the nginx-devel mailing list