Re: Disable HTTP logging for specific backend in HAProxy

2014-12-09 Thread Alexander Minza
Baptiste bedis9@... writes:

 There is a nice option called dontlog-normal which logs only errors.
 http://cbonte.github.io/haproxy-dconv/configuration-
1.5.html#option%20dontlog-normal

The tricky aspect is that this option cannot be set for specific backends.
How does one disable normal logging for a specific backend? Thanks!




Re: Disable HTTP logging for specific backend in HAProxy

2014-12-08 Thread Jonathan Matthews
On 7 December 2014 at 20:54, Alexander Minza alexander.mi...@gmail.com wrote:
 How does one adjust logging level or disable logging altogether for specific
 backends in HAProxy?

 In the example below, both directives http-request set-log-level err and
 no log seem to have no effect - the logs are swamped with lines of
 successful HTTP status 200 OK records.
[snip]
 backend static
   http-request set-log-level err
   no log

Are you /absolutely/ sure that these log lines aren't being emitted by
the frontend or listener through which your backend must have received
the request? Are you expecting that no log to percolate back to the
frontend? I don't /think/ it works that way ... (though I've not
tested).

[ As an aside, the way I read what you've written above is mark *all*
logs from the static backend as err level. Whereas your global
section's log /dev/log local1 notice line says log everything that
is notice-or-more-sever to /dev/log. I know you're no log looks
like it should override this logging, but I just thought I'd mention
it as it looks a little odd. ]

Regards,
Jonathan



Re: Disable HTTP logging for specific backend in HAProxy

2014-12-08 Thread Baptiste
On Mon, Dec 8, 2014 at 1:29 PM, Jonathan Matthews
cont...@jpluscplusm.com wrote:
 On 7 December 2014 at 20:54, Alexander Minza alexander.mi...@gmail.com 
 wrote:
 How does one adjust logging level or disable logging altogether for specific
 backends in HAProxy?

 In the example below, both directives http-request set-log-level err and
 no log seem to have no effect - the logs are swamped with lines of
 successful HTTP status 200 OK records.
 [snip]
 backend static
   http-request set-log-level err
   no log

 Are you /absolutely/ sure that these log lines aren't being emitted by
 the frontend or listener through which your backend must have received
 the request? Are you expecting that no log to percolate back to the
 frontend? I don't /think/ it works that way ... (though I've not
 tested).

 [ As an aside, the way I read what you've written above is mark *all*
 logs from the static backend as err level. Whereas your global
 section's log /dev/log local1 notice line says log everything that
 is notice-or-more-sever to /dev/log. I know you're no log looks
 like it should override this logging, but I just thought I'd mention
 it as it looks a little odd. ]

 Regards,
 Jonathan


Hi Alexander,

You don't disable logging in a backend, since the frontend is
responsible to generate the log line.

If you don't want to log static content, you can do something like this:

acl static ###put your acl rule here
http-request set-log-level silent if static

Baptiste



Re: Disable HTTP logging for specific backend in HAProxy

2014-12-08 Thread Alexander Minza
Baptiste bedis9@... writes:

 You don't disable logging in a backend, since the frontend is
 responsible to generate the log line.
 
 If you don't want to log static content, you can do something like this:
 
 acl static ###put your acl rule here
 http-request set-log-level silent if static
 
 Baptiste

Thanks for your idea, Baptiste - I was trying those directives in the
backends sections. After I moved them to the frontend and set the log
level to silent - it worked.

However, I would like to log just the errors, thus after setting the log level
to err it seems that it is logging again all the requests, not just those
resulting in a  HTTP error from the backend response.

What am I doing wrong? Any ideas? Thanks so much for your help!






Re: Disable HTTP logging for specific backend in HAProxy

2014-12-08 Thread Alexander Minza
Alexander Minza alexander.minza@... writes:

 However, I would like to log just the errors, thus after setting the log level
 to err it seems that it is logging again all the requests, not just those
 resulting in a  HTTP error from the backend response.

Adding the following lines to the backend config section:

no log
log /dev/log local1 err

does not seem to have any effect - the log is still populated with HTTP 200 OK 
requests.




Re: Disable HTTP logging for specific backend in HAProxy

2014-12-08 Thread Baptiste
On Mon, Dec 8, 2014 at 10:20 PM, Alexander Minza
alexander.mi...@gmail.com wrote:
 Alexander Minza alexander.minza@... writes:

 However, I would like to log just the errors, thus after setting the log 
 level
 to err it seems that it is logging again all the requests, not just those
 resulting in a  HTTP error from the backend response.

 Adding the following lines to the backend config section:

 no log
 log /dev/log local1 err

 does not seem to have any effect - the log is still populated with HTTP 200 OK
 requests.



There is a nice option called dontlog-normal which logs only errors.
http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#option%20dontlog-normal

Baptiste



Disable HTTP logging for specific backend in HAProxy

2014-12-07 Thread Alexander Minza
Hi everyone! Thank you for your great work on building and supporting
HAProxy!


How does one adjust logging level or disable logging altogether for
specific backends in HAProxy?

In the example below, both directives *http-request set-log-level err*
and *no log* seem to have no effect - the logs are swamped with lines of
successful HTTP status 200 OK records.

global
   log /dev/log local0
   log /dev/log local1 notice

...

defaults
   log global
   mode http
   option httplog
   option dontlognull

...

backend static
   http-request set-log-level err
   no log



Crosspost:
http://serverfault.com/questions/649826/disable-http-logging-for-specific-backend-in-haproxy