Welcome! Log In Create A New Profile

Advanced

Re: how to use ngx_log_debug during configuration of a core module

Manlio Perillo
March 24, 2010 12:48PM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Maxim Dounin ha scritto:
> [...]
>> 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.
>
> I've just tested and looked through code - module init callbacks
> (init_module member of ngx_module_t structure) are called after
> full configuration has been initialized (including logs) and even
> debug works perfectly using cycle->log (once you have error_log
> ... debug; configured at top level).
>
>>From data you provide it looks like you in fact use create_conf
> or init_conf callbacks of ngx_core_module_t structure.
>

Yes.

> You still should be able to use ngx_log_error(cycle->log), though
> level is initialized to NGX_LOG_NOTICE by default (so it's minimum
> level which will be logged unless you are reconfiguring already
> running nginx).
>

Ah, my bad.
I was using NGX_LOG_INFO, instead of NGX_LOG_NOTICE!

Now notices are logged.


Module is now complete:
http://hg.mperillo.ath.cx/nginx/ngx_python_module/

It is a core Nginx module that embeds the CPython interpreter.
The future version of ngx_http_wsgi_module will require this module.


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

iEYEARECAAYFAkuqQewACgkQscQJ24LbaUSGmwCdFwTOW8ovwkQFT6kIoXl6O6w1
Zx8An1jN4IBVrIwxnG0yjvYcejI5v9Ip
=R0ob
-----END PGP SIGNATURE-----

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

how to use ngx_log_debug during configuration of a core module

Manlio Perillo 4644 March 24, 2010 10:06AM

Re: how to use ngx_log_debug during configuration of a core module

Maxim Dounin 1265 March 24, 2010 10:42AM

Re: how to use ngx_log_debug during configuration of a core module

Manlio Perillo 1216 March 24, 2010 10:58AM

Re: how to use ngx_log_debug during configuration of a core module

Maxim Dounin 1225 March 24, 2010 11:42AM

Re: how to use ngx_log_debug during configuration of a core module

Manlio Perillo 1386 March 24, 2010 12:48PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 131
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready