|
Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
|
Implements native access log and error log helpers. More...
#include "native_http_access_log.h"#include "native_artifact_emit.h"#include "native_fs.h"#include "native_http_log.h"#include "native_support.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <sys/time.h>Go to the source code of this file.
Macros | |
| #define | native_http_access_log_strdup strdup |
Functions | |
| static int | close_logged_file_native (FILE *file) |
| static char * | access_timestamp_native (void) |
| static char * | resolved_error_report_path_native (const char *app_id, const char *error_report_path) |
| static void | write_error_report_native (const char *app_id, const char *error_report_path, const HttpRequest *request, const char *request_path, const char *status_text, const char *reason, const char *resource_path, const char *detail_text) |
| void | native_write_error_log (const char *log_path, const char *error_report_path, const char *app_id, const HttpRequest *request, const char *request_path, const char *status_text, const char *reason, const char *resource_path, const char *detail_text) |
| Writes one structured error log entry and its paired JSONL error report. | |
| void | native_write_access_log (const char *log_path, const HttpRequest *request, const char *request_path, int status_code) |
| Writes one access log entry for a completed HTTP request. | |
Implements native access log and error log helpers.
Definition in file native_http_access_log.c.
| #define native_http_access_log_strdup strdup |
Definition at line 23 of file native_http_access_log.c.
Referenced by access_timestamp_native(), resolved_error_report_path_native(), and write_error_report_native().
|
static |
Definition at line 37 of file native_http_access_log.c.
References native_http_access_log_strdup.
Referenced by native_write_access_log(), native_write_error_log(), and write_error_report_native().
|
static |
Definition at line 26 of file native_http_access_log.c.
Referenced by native_write_access_log(), native_write_error_log(), and write_error_report_native().
| void native_write_access_log | ( | const char * | log_path, |
| const HttpRequest * | request, | ||
| const char * | request_path, | ||
| int | status_code ) |
Writes one access log entry for a completed HTTP request.
| log_path | Access log file path. |
| request | Request that was served. |
| request_path | Normalized request path. |
| status_code | Final HTTP status code. |
Definition at line 197 of file native_http_access_log.c.
References access_timestamp_native(), close_logged_file_native(), compact_log_text_native(), ensure_directory(), HttpRequest::headers, http_status_text_native(), HttpRequest::method, path_dirname(), request_headers_with_client_ip_native(), and request_real_ip_native().
Referenced by handle_app_or_runtime_request(), and native_serve_static_file().
| void native_write_error_log | ( | const char * | log_path, |
| const char * | error_report_path, | ||
| const char * | app_id, | ||
| const HttpRequest * | request, | ||
| const char * | request_path, | ||
| const char * | status_text, | ||
| const char * | reason, | ||
| const char * | resource_path, | ||
| const char * | detail_text ) |
Writes one structured error log entry and its paired JSONL error report.
| log_path | Access or runtime log path. |
| error_report_path | Optional explicit JSONL error report path. |
| app_id | App identifier associated with the failure. |
| request | Request associated with the failure. |
| request_path | Normalized request path. |
| status_text | HTTP status line or reason text. |
| reason | Stable failure reason label. |
| resource_path | Resource path associated with the failure. |
| detail_text | Optional detail text to include. |
Definition at line 142 of file native_http_access_log.c.
References access_timestamp_native(), close_logged_file_native(), compact_log_text_native(), ensure_directory(), HttpRequest::headers, HttpRequest::method, path_dirname(), request_headers_with_client_ip_native(), request_real_ip_native(), and write_error_report_native().
Referenced by handle_app_or_runtime_request(), and native_serve_static_file().
|
static |
Definition at line 52 of file native_http_access_log.c.
References native_http_access_log_strdup.
Referenced by write_error_report_native().
|
static |
Definition at line 66 of file native_http_access_log.c.
References access_timestamp_native(), close_logged_file_native(), ensure_directory(), HttpRequest::headers, json_string_dup_native(), HttpRequest::method, native_http_access_log_strdup, path_dirname(), request_real_ip_native(), and resolved_error_report_path_native().
Referenced by native_write_error_log().