mirror of
https://github.com/3proxy/3proxy.git
synced 2026-10-28 22:05:48 +08:00
A logger (struct logger) is identified by the string log or -l gives it: "" stdout, "/dev/null" none, "@IDENT" syslog, "&DSN" ODBC, "radius", anything else a file. Each type (struct logtype) has init, formatting of a connection into a buffer, writing, close, and a periodic tick for rotation and flushing; ODBC and RADIUS register their types from 3proxy, which alone has them. Services and configurations hold the logger they use; the last to let go closes it, except the standard ones (none, stdout, stderr, syslog), which are opened at startup and kept. -l takes every log type now, and a file named by several services or by both log and -l is opened once. rotate and archiver are bound to the logger of the last log command when its configuration comes into force, and every file logger is rotated by the main loop. Errors with no connection go to a new stderr logger; after daemon, or as a Windows service, stdout logging writes nothing and errors go to the last log configured. A log whose writes keep failing is closed and reopened; while it cannot be, its lines go to stderr and it is retried every minute. ODBC's own reconnection throttle gives way to this. Formatting (logbuf) is separate from counting traffic and clearing the statistics, done once by logdo(), the services' log function, so a later step can format or copy a connection's line and write it from a thread of its own. dologname() and timechanged() move to log.c, which the standalone services link as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| 3proxy.cfg.5.html | ||