# Stop logging to journalctl

**URL:** <https://discourse.haproxy.org/t/stop-logging-to-journalctl/6861>\
**Category:** Help!\
**Created:** [August 27, 2021, 1:30pm UTC](https://discourse.haproxy.org/t/stop-logging-to-journalctl/6861 "2021-08-27T13:30:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sailor](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@Sailor](https://discourse.haproxy.org/u/Sailor)\
**Post date:** [August 27, 2021, 1:30pm UTC](https://discourse.haproxy.org/t/stop-logging-to-journalctl/6861/1 "2021-08-27T13:30:24Z")

</div>

Hello, I’m on v1.8, I want to stop logging the details to journalctl, but keep /var/log/haproxy.log

global  
log /dev/log local2

defaults  
retries 3  
timeout queue 1m  
timeout connect 5s  
timeout client 10s  
timeout server 10s  
timeout http-keep-alive 10s  
timeout check 5s  
log global

listen stats  
bind 10.15.15.123:8404  
mode http  
stats enable  
stats uri /stats  
stats refresh 5s  
stats auth wsadmin:101Ram  
stats admin if LOCALHOST

```
option dontlog-normal

```

frontend devldap  
mode tcp  
bind 10.15.15.22:395  
option tcplog  
default\_backend devldap\_backend

backend devldap\_backend  
mode tcp  
balance roundrobin  
option log-health-checks

```
    server devldap_390_1 ldapd1.com:395 check observe layer4 error-limit 10 on-error mark-down
    server devldap_390_2 ldapd2.com:395 check observe layer4 error-limit 10 on-error mark-down
```

---

<div class="post-metadata">

**Author:** ![Rfraile](https://avatars.discourse-cdn.com/v4/letter/r/50afbb/32.png) [@Rfraile](https://discourse.haproxy.org/u/Rfraile)\
**Post date:** [August 27, 2021, 7:38pm UTC](https://discourse.haproxy.org/t/stop-logging-to-journalctl/6861/2 "2021-08-27T19:38:28Z")

</div>

Set the log to other path different than /dev/log like for example /dev/halog and use rsyslog, for example, to listen there and write the content to /var/log/haproxy.log

---

<div class="post-metadata">

**Author:** ![rhada](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/rhada/32/585_2.png) [@rhada](https://discourse.haproxy.org/u/rhada)\
**Post date:** [August 30, 2021, 6:53am UTC](https://discourse.haproxy.org/t/stop-logging-to-journalctl/6861/3 "2021-08-30T06:53:06Z")

</div>

Hello,

we used to do this with rsyslog.

In haproxy.conf, configure the path where the logs are sent. In global section we have (be careful as it may be a chrooted path):

```auto

global
    log /log local2

    chroot /var/lib/haproxy

```

After we use rsyslog. You have to create the log file as socket file, then configure rsyslog as usual to send the logs where you want :

```auto

# Create an additional socket in haproxy's chroot in order to allow logging via
# /dev/log to chroot'ed HAProxy processes
$AddUnixListenSocket /var/lib/haproxy/log

$template message_only,"%msg%\n"

# Send HAProxy messages to a dedicated logfile
if $programname startswith 'haproxy' then /var/log/haproxy.log;message_only
#& -?haproxy_by_minute;message_only
& stop

```

Restart rsyslog then restart haproxy and you should be able to get your logs in the right file
