# Enable conditional HTTP logging

**URL:** <https://discourse.haproxy.org/t/enable-conditional-http-logging/2614>\
**Category:** Help!\
**Created:** [June 13, 2018, 2:44pm UTC](https://discourse.haproxy.org/t/enable-conditional-http-logging/2614 "2018-06-13T14:44:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![erlo](https://avatars.discourse-cdn.com/v4/letter/e/f07891/32.png) [@erlo](https://discourse.haproxy.org/u/erlo)\
**Post date:** [June 13, 2018, 2:44pm UTC](https://discourse.haproxy.org/t/enable-conditional-http-logging/2614/1 "2018-06-13T14:44:04Z")

</div>

Hello community !

I looking for a solution for my specific need. I have HAproxy servers which are serving huge amount of traffic (peaks with more than 60000 req/s). Currently, HTTP logging is not enable for normal traffic (option dontlog-normal), traffic volume is to high to permit logging in good condition.

I’m looking for a solution to evaluate how many client are SNI compatible. This can be achieve with custom logging format with “%[ssl\_fc\_sni]”.

Do you know if there is a way to enable HTTP logging only when matching criteria (such as the presence of SNI host field) ?

Thanks!

---

<div class="post-metadata">

**Author:** ![Baptiste](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@Baptiste](https://discourse.haproxy.org/u/Baptiste)\
**Post date:** [June 21, 2018, 10:35pm UTC](https://discourse.haproxy.org/t/enable-conditional-http-logging/2614/2 "2018-06-21T22:35:09Z")

</div>

Hi,

You can use something like this:

http-request set-log-level silent if { ssl\_fc\_sni -m found }

That way request containing the SNI won’t be logged.
