Mailing List Archive

mod_perl startup script and logging
Hi.
Linux Debian
Apache httpd 2.4
mod_perl 2.0.9

...
PerlPostConfigRequire "/etc/apache2/modperl2_startup.pl"
...

modperl2_startup.pl contains the usual "use" directives, including
use Apache2::ServerRec ();
use Apache2::ServerUtil ();
use Apache2::Log ();

If in this script, I would like to log something to the Apache server log (error_log), how
do I do that ?
(I mean e.g., how can I get the server object, from inside modperl2_startup.pl ?)
Re: mod_perl startup script and logging [ In reply to ]
Sorry, never mind, found it :

my $server = Apache2::ServerUtil->server();
my $apache_version = Apache2::ServerUtil::get_server_version();
$server->log_error("mp2-startup: server version is " . $apache_version);

On 10.04.2016 16:48, André Warnier (tomcat) wrote:
> Hi.
> Linux Debian
> Apache httpd 2.4
> mod_perl 2.0.9
>
> ...
> PerlPostConfigRequire "/etc/apache2/modperl2_startup.pl"
> ...
>
> modperl2_startup.pl contains the usual "use" directives, including
> use Apache2::ServerRec ();
> use Apache2::ServerUtil ();
> use Apache2::Log ();
>
> If in this script, I would like to log something to the Apache server log (error_log), how
> do I do that ?
> (I mean e.g., how can I get the server object, from inside modperl2_startup.pl ?)
>