Mailing List Archive

Possible to add timestamp to application logs (e.g. stderr)?
Is it possible to add a timestamp prefix to messages logged by an
application, e.g. to stderr?

I was hoping that ErrorLogFormat would do this, but it seems that only
applies to messages logged by the server.

Sebb

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Possible to add timestamp to application logs (e.g. stderr)? [ In reply to ]
On Sat, Apr 29, 2023 at 2:54?PM sebb <sebbaz@gmail.com> wrote:
>
> Is it possible to add a timestamp prefix to messages logged by an
> application, e.g. to stderr?
>
> I was hoping that ErrorLogFormat would do this, but it seems that only
> applies to messages logged by the server.

stderr inside the server itself goes to the main/global ErrorLog,
there is nothing fancy intercepting it.
mod_cgid in trunk only does wrap what the CGI writes to its stderr:
https://bz.apache.org/bugzilla/show_bug.cgi?id=54221

as the bug says, mod_cgi (single-threaded apache) always passed the
stderr output from the CGI into apache logging. Other interfaces into
the server for apps could go either way.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Possible to add timestamp to application logs (e.g. stderr)? [ In reply to ]
On Sat, 29 Apr 2023 at 21:08, Eric Covener <covener@gmail.com> wrote:
>
> On Sat, Apr 29, 2023 at 2:54?PM sebb <sebbaz@gmail.com> wrote:
> >
> > Is it possible to add a timestamp prefix to messages logged by an
> > application, e.g. to stderr?
> >
> > I was hoping that ErrorLogFormat would do this, but it seems that only
> > applies to messages logged by the server.
>
> stderr inside the server itself goes to the main/global ErrorLog,
> there is nothing fancy intercepting it.
> mod_cgid in trunk only does wrap what the CGI writes to its stderr:
> https://bz.apache.org/bugzilla/show_bug.cgi?id=54221
>
> as the bug says, mod_cgi (single-threaded apache) always passed the
> stderr output from the CGI into apache logging. Other interfaces into
> the server for apps could go either way.

I see.

The 2.4 documentation for mod_cgi and mod_cgid says that they behave
essentially the same, but it seems that is not the case.

It would be helpful if this difference were documented.

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org