summaryrefslogtreecommitdiffstats
path: root/server/log.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* core: log_tid support on FreeBSD.Yann Ylavic2022-06-161-2/+8
| | | | | | | | | | | Use pthread_getthreadid_np() when available. BZ: 65835 Submitted by: David CARLIER <devnexen gmail.com> git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1901975 13f79535-47bb-0310-9956-ffa450edef68
* core: Add ap_create_connection() to create a server or client/proxy connection.Yann Ylavic2021-09-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | c->outgoing shouldn't be set by mod_ssl, ap_create_connection() allows that and this commit also replaces all the calls to ap_run_create_connection() in mod_proxy modules (not in the MPMs which create incoming connections only). * include/http_connection.h, server/connection.c: Declare and implement ap_create_connection(). * modules/proxy/proxy_util.c, modules/proxy/mod_proxy_connect.c, modules/proxy/mod_proxy_ftp.c: Use ap_create_connection() instead of ap_run_create_connection(), and don't provide a connection_id a scoreboard handle for outgoing connection. * server/log.c(do_errorlog_default): Use c->outgoing instead of c->sbh to determine if it's a "client" or "remote" connection. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893184 13f79535-47bb-0310-9956-ffa450edef68
* Fix an harmless warning spoted by gcc 10 and -Werror=discarded-qualifiersChristophe Jaillet2020-11-151-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1883452 13f79535-47bb-0310-9956-ffa450edef68
* Check for and use gettid() directly if available; glibc 2.30 and laterJoe Orton2020-07-071-3/+7
| | | | | | | | | | | | provides a wrapper for the system call: * configure.in: Check for gettid() and define HAVE_SYS_GETTID if gettid() is only usable via syscall(). * server/log.c (log_tid): Use gettid() directly if available. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879591 13f79535-47bb-0310-9956-ffa450edef68
* ap_log_pid(): Windown does not implement apr_file_perms_set(), not a failure.Yann Ylavic2020-05-121-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1877645 13f79535-47bb-0310-9956-ffa450edef68
* * server/log.c (ap_log_pid): Use more traditional C style in httpd forJoe Orton2020-03-161-8/+4
| | | | | | | exception-handling. No functional change. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1875240 13f79535-47bb-0310-9956-ffa450edef68
* * server/log.c (ap_log_pid): Use a temporary file, then rename onceJoe Orton2020-03-131-7/+26
| | | | | | | | | | | | | successfully written; also add error checking. Avoids startup failures if a previous httpd invocation crashed while writing the pidfile. Submitted by: Nicolas Carrier <carrier.nicolas0 gmail.com>, jorton Github: closes #100, closes #69 PR: 63140 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1875153 13f79535-47bb-0310-9956-ffa450edef68
* Fix spelling errors found by codespell. [skip ci]Mike Rumph2020-02-131-3/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1873985 13f79535-47bb-0310-9956-ffa450edef68
* add server_rec to log.c fatal startup errorsEric Covener2018-06-191-10/+10
| | | | | | | | | | | | Not strictly necessary for trunk, but in 2.4.x if the main ErrorLog is using syslog, these messages are lost. In trunk, the low-level logging routines reach up and find the syslog provider when no server_rec is provided but that backport is stalled. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1833827 13f79535-47bb-0310-9956-ffa450edef68
* Follow up to r1715880: revert abusive ap_casecmpstr[n]() usages.Yann Ylavic2015-11-241-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1716151 13f79535-47bb-0310-9956-ffa450edef68
* More ap_casecmpstr[n]() usages (follow up to r1715876).Yann Ylavic2015-11-231-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715880 13f79535-47bb-0310-9956-ffa450edef68
* Silence a sparse warning about inconsistent indenting + some minor style issuesChristophe Jaillet2015-08-311-3/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1700336 13f79535-47bb-0310-9956-ffa450edef68
* core: Follow up to r1599601: s/ap_log_common/ap_log_mpm_common/.Yann Ylavic2015-05-161-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1679714 13f79535-47bb-0310-9956-ffa450edef68
* Tab vs spaceChristophe Jaillet2015-02-061-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1657949 13f79535-47bb-0310-9956-ffa450edef68
* MPMs, core: make duplicated listeners (SO_REUSEPORT) introduced in r1599531Yann Ylavic2014-10-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | less intrusive. Submitted by: Yingqi Lu <yingqi.lu@intel.com> Modified/Committed by: ylavic Add ListenCoresBucketsRatio which is a configurable ratio between the number of CPU cores (online) and the number of listeners buckets to create, defaulting to zero (so that listeners buckets become an opt-in, ie. ncpus / ratio > 1). This could also be made an opt-out by using the previous hardcoded value (8) as default. Make ap_close_listeners() act on all the listeners (including duplicated ones), since the function is also called externally (eg. mod_cgid, mod_ssl_ct and possibly any third party module) to cleanup opened descriptors when a process is forked (the duplicated listeners are kept in a scoped/static variable). Add ap_close_listeners_ex() to close a single bucket of listeners, used by the children to close unused duplicates and internally by ap_close_listeners(). Make ap_duplicate_listeners() compute the number of buckets to be used, instead of each MPM. This number is now based on the above ratio and will not change unless asked to (given *num_buckets < 1, that is when the MPM does not run in one-process mode nor after a graceful restart). Remove some global variables (mpm_listen, enable_default_listeners) previously used to communicate between MPMs and ap_listen, since ap_duplicate_listeners() API can now be used to do so. Also rename num_buckets as ap_num_listen_buckets, and prefix have_so_reuseport with ap_ (both printed by ap_log_common(), hence kept global). Detect ap_have_so_reuseport once only at startup. Restore dummy_connection() as before r1599531 since sending POD signals should not depend on the number of listeners buckets (there is still one single socket receiving the connections). For each MPM (concerned), move the bucket data (pod, listeners and eventually accept mutex) into a struct and instanciate an array of them (sized by the number of buckets), for each child to use its own data according to its bucket index, and the parent to maintain the whole. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1635521 13f79535-47bb-0310-9956-ffa450edef68
* We really need some place where we can place a wholeJim Jagielski2014-06-031-0/+10
| | | | | | | | bunch of data/info-that-should-be-logged-by-all-mpms. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1599601 13f79535-47bb-0310-9956-ffa450edef68
* Follow-up to r1512819:Jeff Trawick2014-02-071-1/+4
| | | | | | | | | | Don't include "\" in the printable form of the data because it will be escaped later in processing, and the extra escaping throws off the alignment. Just filter it out like unprintable characters. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1565777 13f79535-47bb-0310-9956-ffa450edef68
* Follow-up to r1539988:Jeff Trawick2013-11-201-3/+4
| | | | | | | | Make sure an error log provider has initialized before trying to log to it. (A log function may be called in a window between closing stderr and opening logs.) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1543979 13f79535-47bb-0310-9956-ffa450edef68
* Do not lose log messages with NULL server_rec when error log provider is used.Jan Kaluža2013-11-081-6/+26
| | | | | | | | | - set stderr_log to NULL after it is redirected to /dev/null - use log provider of ap_server_conf in log_error_core when no server_rec is provided and std_err_log is NULL git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1539988 13f79535-47bb-0310-9956-ffa450edef68
* don't ignore some apr_procattr failures (clang scan-build)Jeff Trawick2013-10-231-2/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1534995 13f79535-47bb-0310-9956-ffa450edef68
* Follow-up to r1525597:Jeff Trawick2013-10-151-0/+12
| | | | | | | | | Initialize error log providers in vhosts, solving crashes when logging from those vhosts as well as allowing a different provider (or provider configuration) for vhosts. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1532344 13f79535-47bb-0310-9956-ffa450edef68
* avoid needless apr_pstrdup()Jeff Trawick2013-10-151-6/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1532122 13f79535-47bb-0310-9956-ffa450edef68
* Fix the null device name on Windows so that stderr can be sentJeff Trawick2013-09-271-2/+9
| | | | | | | | to the bit bucket. (This logic is always hit when using an error log provider.) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1527008 13f79535-47bb-0310-9956-ffa450edef68
* When adding APR_EOL_STR in the error log record before callingJeff Trawick2013-09-271-0/+1
| | | | | | | the writer, include that trailer in the length. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1527005 13f79535-47bb-0310-9956-ffa450edef68
* Error log providers need to be able to trigger a startup error from theirJeff Trawick2013-09-271-0/+4
| | | | | | | init() function. A NULL return code is the trigger. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1527003 13f79535-47bb-0310-9956-ffa450edef68
* Suppress formatting of startup messages written to the console whenJeff Trawick2013-09-241-1/+1
| | | | | | | ErrorLogFormat is used. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1525931 13f79535-47bb-0310-9956-ffa450edef68
* Add AP_ERRORLOG_PROVIDER_ADD_EOL_STR flag for ap_errorlog_provider, bump MMN.Jan Kaluža2013-09-241-5/+9
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1525845 13f79535-47bb-0310-9956-ffa450edef68
* allow the provider to decide whether or not APLOG_NOTICEJeff Trawick2013-09-231-18/+9
| | | | | | | messages should be logged git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1525664 13f79535-47bb-0310-9956-ffa450edef68
* Add ap_errorlog_provider to make ErrorLog logging modular. MoveJan Kaluža2013-09-231-106/+22
| | | | | | | syslog support from core to new mod_syslog. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1525597 13f79535-47bb-0310-9956-ffa450edef68
* Add ap_log_data(), ap_log_rdata(), etc. for logging buffers.Jeff Trawick2013-08-101-0/+135
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1512819 13f79535-47bb-0310-9956-ffa450edef68
* use ap_log_error's facility to print the apr error string instead ofStefan Fritsch2013-03-311-16/+13
| | | | | | | calling apr_strerror() explicitly git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1463052 13f79535-47bb-0310-9956-ffa450edef68
* only write the first len chars to syslog, as the buffer may have additionalJeff Trawick2012-10-181-1/+2
| | | | | | | text added speculatively git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1399708 13f79535-47bb-0310-9956-ffa450edef68
* style tweakJeff Trawick2012-10-181-2/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1399687 13f79535-47bb-0310-9956-ffa450edef68
* Add a few AP_DEBUG_ASSERT()s for the benefit of clangStefan Fritsch2012-09-141-1/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1384913 13f79535-47bb-0310-9956-ffa450edef68
* The Pidfile directive and ap_log_pid()/ap_remove_pid()/ap_read_pid()Jeff Trawick2012-08-061-3/+3
| | | | | | | now respect DefaultRuntimeDir git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1369808 13f79535-47bb-0310-9956-ffa450edef68
* Fix segfault in logging if r->useragent_addr or c->client_addr is unsetStefan Fritsch2012-04-221-4/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1328950 13f79535-47bb-0310-9956-ffa450edef68
* Further clarify the naming of the entity that directly connects to us byGraham Leggett2011-12-141-4/+4
| | | | | | | calling that entity a client instead of a peer. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1214015 13f79535-47bb-0310-9956-ffa450edef68
* Further clarify the naming of the entity that originates the request byGraham Leggett2011-12-141-5/+5
| | | | | | | calling that entity a useragent instead of a client. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1214005 13f79535-47bb-0310-9956-ffa450edef68
* Add lots of unique tags to error log messagesStefan Fritsch2011-12-031-24/+24
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
* Introduce a per connection "peer_ip" and a per request "client_ip" toGraham Leggett2011-11-251-7/+7
| | | | | | | | distinguish between the raw IP address of the connection and the effective IP address of the request. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1206291 13f79535-47bb-0310-9956-ffa450edef68
* Align the format variable for the raw IP between the error_log and theGraham Leggett2011-11-221-12/+1
| | | | | | | access_log. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1205061 13f79535-47bb-0310-9956-ffa450edef68
* Introduce a per request version of the remote IP address, which can beGraham Leggett2011-11-221-6/+25
| | | | | | | | optionally modified by a module when the effective IP of the client is not the same as the real IP of the client (such as a load balancer). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204968 13f79535-47bb-0310-9956-ffa450edef68
* Pass ap_errorlog_info to error_log hook.Stefan Fritsch2011-11-211-7/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204614 13f79535-47bb-0310-9956-ffa450edef68
* Fix logic when to call error_log hookStefan Fritsch2011-11-211-2/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204595 13f79535-47bb-0310-9956-ffa450edef68
* add conn_rec to error log hookJeff Trawick2011-11-181-5/+5
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1203634 13f79535-47bb-0310-9956-ffa450edef68
* Fix per-request / per-conn logging, probably broken by r1041140Stefan Fritsch2011-11-091-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199591 13f79535-47bb-0310-9956-ffa450edef68
* Cleanup effort in prep for GA push:Jim Jagielski2011-09-231-15/+15
| | | | | | | | Trim trailing whitespace... no func change git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
* Fix logging of the log id of subrequestsStefan Fritsch2011-07-021-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1142160 13f79535-47bb-0310-9956-ffa450edef68
* Add support to ErrorLogFormat for logging the system uniqueStefan Fritsch2011-06-221-1/+15
| | | | | | | thread id under Linux git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1138616 13f79535-47bb-0310-9956-ffa450edef68
* Introduce ap_(get|set)_core_module_config() functions/macros and use themStefan Fritsch2011-06-061-2/+4
| | | | | | | | | | | | everywhere. We know that the core module has module_index 0. Therefore we can save some pointer operations in ap_get_module_config(cv, &core_module) and ap_set_module_config(cv, &core_module, val). As these are called rather often, this may actually have some (small) measurable effect. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132781 13f79535-47bb-0310-9956-ffa450edef68