-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logs #45
Comments
Logs can be sent directly to syslog. No, you don't need consul-template. If you are interested, there is a presentation done a few months ago about features and architecture of project that has been put online recently: https://www.haproxy.com/user-spotlight-series/building-a-service-mesh-at-criteo-with-consul-and-haproxy/ |
Yes i saw that project and thank you. I'm using Consul's dashboard and counting example - no docker or k8s. Here's what i noticed: ./haproxy-consul-connect -dataplane /opt/haproxy/bin/dataplaneapi -haproxy /opt/haproxy/bin/haproxy -sidecar-for counting-1 -stats-addr 0.0.0.0:1936 -stats-service-register and /var/log/messages do not show any http stats either: I can hit the service and see prometheus style metrics with port :1936/metrics. No http access logs or stats page since in the generated tmp haproxy.conf stats are not enabled. I've an issue with intentions not being honored, will open a different issue about that. HAProxy version: 2.0.9 (can't use latest due to other reasons) And Build from: [email protected]:haproxytech/dataplaneapi.git Thanks for your help! |
In theory, logs from HAProxy are sent to the same log channel as logs from app and prefixed with
You can tune the log level with the flag What are the logs you are expecting ? |
Sorry perhaps i'm not clear. I'm referring to httplog and tcplog directives. We rely on these quite heavily. We've more than 100 instances of haproxy across multiple environments. When HAProxy is run as a Layer 7 proxy via mode http, you should add the option httplog directive. It ensures that HTTP requests and responses are analyzed in depth and that no RFC-compliant content will go uncaptured. This is the mode that really highlights the diagnostic value of HAProxy. The HTTP log format provides the same level of information as the TCP format, but with additional data specific to the HTTP protocol. If you were to re-create this format using log-format, it would look like this: This is from haproxy docs. Also, stats page results in "404" http://:<stats_port>/stats but Prometheus metrics works on http://:<stats_port>/metrics Thanks for the help! |
Log level |
Thanks will try that. HAProxy itself doesn't need tracing or even debug to generate httplog. I know this is different. Appreciate the help |
Command i used: Log level trace does not work at all. Debug works but no http response/request logs like i mentioned before. When i use "-log-level trace" I see below messages: DEBU[0015] sending dataplane req: POST /v2/services/haproxy/configuration/log_targets?parent_type=frontend&parent_name=front_downstream&transaction_id=16030995-6187-4b7d-be16-a16d4a987dde Thanks |
How do i get haproxy stats and logs? Do we need to use consul-template for those?
The text was updated successfully, but these errors were encountered: