Skip to content
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

Json log for v2.4 #353

Open
wants to merge 7 commits into
base: 2.4.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions include/httpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -1868,6 +1868,18 @@ AP_DECLARE(char *) ap_escape_html2(apr_pool_t *p, const char *s, int toasc);
*/
AP_DECLARE(char *) ap_escape_logitem(apr_pool_t *p, const char *str);

/**
* Escape a string for JSON UTF-8 string (https://www.rfc-editor.org/rfc/rfc8259#section-7)
* Assumes ISO_8859-1 encoding when encountering bytes > 0x7f
* Will try to parse input string as UTF-8
* @param p The pool to allocate from
* @param str The string to escape. Can be NULL, which will then return escaped string 'null'
* @param len The length of the input string. The length of the output string. Can be NULL
* @param quoted boolean if the output string should get quoted with \"
* @return The escaped string
*/
AP_DECLARE(const char *) ap_escape_logjson(apr_pool_t *p, const char *str, apr_size_t *len, int quoted);

/**
* Escape a string for logging into the error log (without a pool)
* @param dest The buffer to write to
Expand Down
Loading