Hi Tristan,

On Wed, Oct 18, 2023 at 04:25:47PM +0000, Tristan wrote:
> 
> 
> > ...
> > > One last thing, SEND_ERR() reports to stderr through ha_alert() and
> > > hlua_sendlog() does it through fprintf(stderr, ) by appending a static
> > > header containing the log level, the date and the pid: maybe we should
> > > try to unify those outputs as well?
> > 
> > I'm not sure anyone really *wants* to have to configure all that stuff
> > for error reporting. Maybe the format is not great, maybe it should use
> > send_log() etc, quite frankly I don't know as I have not visited that
> > part. [...]
> 
> To be honest here I'm somewhat on Aurélien's side. I would actually
> appreciate a lua-log-format sort of configurable option.
> 
> Mainly so I can prefix (for example) with the timestamp and request id, like
> I do for HTTP traffic.
>
> Since raw output means it looks a bit odd in logs, and enforcing prefixes
> inside scripts is a bit of a maintenance burden (and error prone +
> expensive).

So if it's a prefix it's not "log-format". I prefer to insist on this
because "log-format" defines the payload, and there are other elements
for the header format, such as the "format" keyword on the "log" line
which lets one choose what the log's envelope will look like:

  http://docs.haproxy.org/dev/configuration.html#4.2-log%20global

It supports "local", "rfc3164", "rfc5424", "priority", "short", "timed",
"iso", "raw". Some have the date and pid, others not etc. Normally these
are common to all logs emitted on the same target.

Log-formats on the opposite use expressions that heavily depend on
streams, such as request time, queue time, response time, frontend,
backend, server used, server cookie, captures, request etc, which have
nothing to do with an error or alert that Lua might want to emit.

Willy

Reply via email to