CompTIa guide says:
A web application firewall (WAF) is an application-layer security control that can
apply a set of rules to HTTP traffic. Where a stateful packet filtering firewall can apply
rules to IP and TCP/UDP layer information, a WAF can parse response and request
headers and the HTML message body in HTTP packets and apply detection and filtering
rules to the contents. These rules address web-based exploits and vulnerabilities, like
SQL injection attacks and cross-site scripting (XSS) attacks.
Traffic that matches a suspicious or unwanted signature will typically be logged with
the source and destination addresses, why the traffic triggered an alert (what known
suspicious behavior it matched), and what action was taken (based on the configured
rule). The actual composition of the log will differ between WAF vendors. WAFs can
be configured to record extensive log information, which can be tricky to handle in
a standard log format such as W3C.