Skip to content

Instantly share code, notes, and snippets.

@haproxytechblog
Created October 8, 2021 15:21
Show Gist options
  • Save haproxytechblog/48826dd52786672bff3062154e0a8b6d to your computer and use it in GitHub Desktop.
Save haproxytechblog/48826dd52786672bff3062154e0a8b6d to your computer and use it in GitHub Desktop.
Announcing HAProxy Data Plane API 2.4
$ sudo dataplaneapi \
--host 127.0.0.1 \
--port 5555 \
--haproxy-bin /usr/sbin/haproxy \
--config-file /etc/haproxy/haproxy.cfg \
--reload-delay 5 \
--reload-cmd "service haproxy reload" \
--restart-cmd "service haproxy restart" \
--userlist haproxy-dataplaneapi \
--transaction-dir /tmp/haproxy
--log-to file
--log-file /var/log/dataplaneapi/dataplaneapi.log
--log-level info
--log-format json
log_targets:
- log_to: file
log_file: /var/log/dataplaneapi/dataplaneapi.log
log_level: info
log_format: json
log_types:
- access
- app
log_targets = [
{
log_to = "file"
log_file = “/var/log/dataplaneapi/dataplaneapi.log”
log_level = "info"
log_format = "json"
log_types = [
"access",
"app",
]
},
]
log_targets:
- log_to: stdout
log_level: debug
log_format: text
log_types:
- access
- app
- log_to: file
log_file: /var/log/dataplanepi.log
log_level: info
log_format: json
log_types:
- app
- log_to: syslog
log_level: info
syslog_address: 127.0.0.1
syslog_protocol: tcp
syslog_tag: dataplaneapi
syslog_level: debug
syslog_facility: local0
log_types:
- access
log_targets = [
{
log_to = "stdout"
log_level = "debug"
log_format = "text"
log_types = [
"access",
"app",
]
},
{
log_to = "file"
log_file = "/var/log/dataplanepi.log"
log_level = "info"
log_format = "json"
log_types = ["app"]
},
{
log_to = "syslog"
log_level = "info"
syslog_address = "127.0.0.1"
syslog_protocol = "tcp"
syslog_tag = "dataplaneapi"
syslog_level = "debug"
syslog_facillity = "local0"
log_types = ["access"]
},
]
time="2021-10-01T12:51:57+02:00" level=info msg="started handling request" method=GET remote="[::1]:36924" request=/v2
time="2021-10-01T12:51:57+02:00" level=info msg="completed handling request" length=705B request_id=01FGXQPVAYE48Z26JQB81D99JJ status=200 took=4.468977ms
time="2021-10-01T12:54:44+02:00" level=info msg="[::1] - - [01/Oct/2021:12:54:44 +0200] \"GET /v2 HTTP/1.1 200 705 \"-\" \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36\" 4768"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment