Commit graph

70 commits

Author SHA1 Message Date
Florian Obser
c371be3f9f
Do not shadow tm on line 236. (#1243) 2025-02-25 09:36:44 +01:00
W.C.A. Wijngaards
84eeb9b97c - Fix #1144: [FR] log timestamps in ISO8601 format with timezone.
This adds the option `log-time-iso: yes` that logs in ISO8601
  format.
2024-09-25 11:16:46 +02:00
Stuart Henderson
ed00129866
add void to log_ident_revert_to_default declaration
Avoid warning from LLVM 16:

util_log.c:190:33: warning: a function declaration without a prototype is deprecated in all versions of C             
[-Wstrict-prototypes]                                                                                                 
void log_ident_revert_to_default()                                                                                    
                                ^                                                                                     
                                 void
2023-09-05 14:28:06 +00:00
George Thessalonikefs
da2bda6f4d - Clean debug comments. 2020-02-10 15:54:41 +01:00
George Thessalonikefs
adda4f6ace - Fix use after free on log-identity after a reload; Fixes #163. 2020-02-10 13:56:22 +01:00
Renaud Métrich
d63cb99649 Changed log lock from 'quick' to 'basic' because this is an I/O lock.
We cannot use a 'quick' lock (i.e. lock spinning on the CPU) for the log
lock because it can wait a lot on I/Os. Using a 'quick' lock leads to
eating the CPU for no good reason.

Example of 'pidstat' output when using various locks for log_lock:

- 'quick' lock and slow log file system (tail -f on the log file on XFS on RHEL 8)

04:15:11 PM   UID      TGID       TID    %usr %system    %CPU CPU  Command
04:15:21 PM   998     16431         -  100.00    4.20  100.00   2  unbound
04:15:21 PM   998         -     16431   31.00    1.00   32.00   2  |__unbound
04:15:21 PM   998         -     16432   31.30    0.80   32.10   0  |__unbound
04:15:21 PM   998         -     16433   30.20    1.40   31.60   1  |__unbound
04:15:21 PM   998         -     16434   30.70    1.00   31.70   3  |__unbound

- 'quick' lock and log file system being fast

04:15:40 PM   UID      TGID       TID    %usr %system   %CPU CPU  Command
04:15:50 PM   998     16431         -   10.00    1.60  11.60   1  unbound
04:15:50 PM   998         -     16431    2.50    0.50   3.00   1  |__unbound
04:15:50 PM   998         -     16432    2.30    0.40   2.70   3  |__unbound
04:15:50 PM   998         -     16433    2.70    0.30   3.00   0  |__unbound
04:15:50 PM   998         -     16434    2.60    0.40   3.00   2  |__unbound

- 'basic' lock (this commit) and slow log file system (tail -f on the log file on XFS on RHEL 8)

04:29:48 PM   UID      TGID       TID    %usr %system   %CPU CPU  Command
04:29:58 PM   998     11632         -    7.10   14.10  21.20   3  unbound
04:29:58 PM   998         -     11632    1.70    3.20   4.90   3  |__unbound
04:29:58 PM   998         -     11633    1.60    3.30   4.90   1  |__unbound
04:29:58 PM   998         -     11634    2.00    4.10   6.10   1  |__unbound
04:29:58 PM   998         -     11635    1.90    3.50   5.40   1  |__unbound

We can see in the above example, when 'basic' lock is used, that CPU
isn't consumed when log file system is slow.

Another reproducer scenario: put the log file on a NFS share with 'sync'
option.
2019-11-26 16:32:07 +01:00
W.C.A. Wijngaards
3a49e683ed - Fix Enum Name not Used, reported by X41 D-Sec. 2019-11-20 14:22:06 +01:00
W.C.A. Wijngaards
e45e9f1ce0 - Fix #72: configure --with-syslog-facility=LOCAL0-7 with default
LOG_DAEMON (as before) can set the syslog facility that the server
  uses to log messages.
2019-09-09 14:27:55 +02:00
Wouter Wijngaards
2ad55ba791 - log-tag-queryreply: yes in unbound.conf tags the log-queries and
log-replies in the log file for easier log filter maintenance.


git-svn-id: file:///svn/unbound/trunk@5000 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-11-30 09:45:37 +00:00
Wouter Wijngaards
c9955f9fdf - Fix #4152: Logs shows wrong time when using log-time-ascii: yes.
git-svn-id: file:///svn/unbound/trunk@4957 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-10-25 13:52:13 +00:00
Wouter Wijngaards
0e390bca00 - Fix compile without threads, and remove unused variable.
git-svn-id: file:///svn/unbound/trunk@4553 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-02-27 10:36:12 +00:00
Wouter Wijngaards
30891d6fff - Fix unfreed locks in log and arc4random at exit of unbound.
git-svn-id: file:///svn/unbound/trunk@4491 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-02-02 09:27:16 +00:00
Wouter Wijngaards
1a44a8402e - Fix #1268: SIGSEGV after log_reopen.
git-svn-id: file:///svn/unbound/trunk@4177 be551aaa-1e26-0410-a405-d3ace91eadb9
2017-05-22 07:20:59 +00:00
Wouter Wijngaards
c010e93d4a - Fix to rename internally used types from _t to _type, because _t
type names are reserved by POSIX.
- iana portlist update


git-svn-id: file:///svn/unbound/trunk@3989 be551aaa-1e26-0410-a405-d3ace91eadb9
2017-01-19 10:25:41 +00:00
Wouter Wijngaards
b2bdce46be - rename ldns subdirectory to sldns to avoid name collision.
git-svn-id: file:///svn/unbound/trunk@3380 be551aaa-1e26-0410-a405-d3ace91eadb9
2015-03-26 10:21:38 +00:00
Wouter Wijngaards
29f18d8f86 - Fixup compile on cygwin, more portable openssl thread id.
git-svn-id: file:///svn/unbound/trunk@3362 be551aaa-1e26-0410-a405-d3ace91eadb9
2015-03-16 10:51:32 +00:00
Wouter Wijngaards
436d057765 cleaner compile without locks enabled.
git-svn-id: file:///svn/unbound/trunk@3157 be551aaa-1e26-0410-a405-d3ace91eadb9
2014-07-04 07:43:20 +00:00
Wouter Wijngaards
c5bf2cf802 - Fix #593: segfault or crash upon rotating logfile.
git-svn-id: file:///svn/unbound/trunk@3156 be551aaa-1e26-0410-a405-d3ace91eadb9
2014-07-04 07:34:58 +00:00
Wouter Wijngaards
2b90f38a70 And fix #551 REGENT to COPYRIGHT HOLDER in license in file headings.
git-svn-id: file:///svn/unbound/trunk@3079 be551aaa-1e26-0410-a405-d3ace91eadb9
2014-02-07 13:28:39 +00:00
Wouter Wijngaards
3ce7b4a6fa - Windows port, adjust %lld to %I64d, and warning in win_event.c.
git-svn-id: file:///svn/unbound/trunk@3040 be551aaa-1e26-0410-a405-d3ace91eadb9
2014-01-16 16:01:37 +00:00
Wouter Wijngaards
d3cbd76546 - Fix sldns to use sldns_ prefix for all ldns_ variables.
git-svn-id: file:///svn/unbound/trunk@3022 be551aaa-1e26-0410-a405-d3ace91eadb9
2013-12-03 09:11:16 +00:00
Wouter Wijngaards
29e96e86c9 - separate ldns into core ldns inside ldns/ subdirectory. No more
--with-ldns is needed and unbound does not rely on libldns.


git-svn-id: file:///svn/unbound/trunk@2998 be551aaa-1e26-0410-a405-d3ace91eadb9
2013-10-31 15:09:26 +00:00
Wouter Wijngaards
c845aceee4 - more fixes that I overlooked.
git-svn-id: file:///svn/unbound/trunk@2944 be551aaa-1e26-0410-a405-d3ace91eadb9
2013-08-22 07:33:51 +00:00
Wouter Wijngaards
f1fd2b53eb - Fix for 2038, with time_t instead of uint32_t.
git-svn-id: file:///svn/unbound/trunk@2939 be551aaa-1e26-0410-a405-d3ace91eadb9
2013-08-20 12:23:42 +00:00
Wouter Wijngaards
eb03758c79 - implement log-time-ascii on windows.
git-svn-id: file:///svn/unbound/trunk@2684 be551aaa-1e26-0410-a405-d3ace91eadb9
2012-06-15 08:24:44 +00:00
Wouter Wijngaards
46d341b036 please lint
git-svn-id: file:///svn/unbound/trunk@1829 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-10 15:07:18 +00:00
Wouter Wijngaards
7923a28c13 line buffering
git-svn-id: file:///svn/unbound/trunk@1828 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-10 14:33:46 +00:00
Wouter Wijngaards
ac4535d4e5 log and tests fixups.
git-svn-id: file:///svn/unbound/trunk@1521 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-12 09:36:28 +00:00
Wouter Wijngaards
8c2d5d42d9 windows work.
git-svn-id: file:///svn/unbound/trunk@1520 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-11 16:32:07 +00:00
Wouter Wijngaards
c2261b63f1 fixup warnings on vista/mingw.
git-svn-id: file:///svn/unbound/trunk@1494 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-24 15:38:23 +00:00
Wouter Wijngaards
63d3cb7ff4 log-time-ascii option
git-svn-id: file:///svn/unbound/trunk@1465 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-06 12:51:45 +00:00
Wouter Wijngaards
05643589cf better #219 fix.
git-svn-id: file:///svn/unbound/trunk@1386 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-11 08:14:22 +00:00
Wouter Wijngaards
ee874fab01 please doxygen.
git-svn-id: file:///svn/unbound/trunk@1195 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-18 08:36:28 +00:00
Wouter Wijngaards
8cbb13f251 Better logfile classification for log_bug, log_hex and log_addr.
git-svn-id: file:///svn/unbound/trunk@1194 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-18 08:17:07 +00:00
Wouter Wijngaards
77b79fde5d bug fixes 203, 204, 206.
git-svn-id: file:///svn/unbound/trunk@1186 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-13 07:11:42 +00:00
Wouter Wijngaards
4263f2a692 - lowered log_hex blocksize to fit through BSD syslog linesize.
- no useless initialisation if getpwnam not available.
- iana, ldns snapshot updated.



git-svn-id: file:///svn/unbound/trunk@1150 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-15 15:05:12 +00:00
Wouter Wijngaards
7a528cdf53 set USE_WINSOCK if on windows. error string routine. start and clean winsock.
git-svn-id: file:///svn/unbound/trunk@1123 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-16 15:02:52 +00:00
Wouter Wijngaards
b2710818d4 Faster due to time-sharing.
git-svn-id: file:///svn/unbound/trunk@966 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-19 13:12:23 +00:00
Wouter Wijngaards
d7f47f4de6 nice option interface. Nice debug output stream option.
git-svn-id: file:///svn/unbound/trunk@945 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-11 15:22:57 +00:00
Wouter Wijngaards
849026931b move around debug levels.
git-svn-id: file:///svn/unbound/trunk@929 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-07 09:46:49 +00:00
Wouter Wijngaards
e297886386 abort gone
git-svn-id: file:///svn/unbound/trunk@812 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-06 17:38:15 +00:00
Wouter Wijngaards
75073cefea library resolution working.
git-svn-id: file:///svn/unbound/trunk@809 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-06 15:11:07 +00:00
Wouter Wijngaards
2e9785cfb5 better chroot support, and also default chroot and userchange.
git-svn-id: file:///svn/unbound/trunk@723 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-31 10:56:31 +00:00
Wouter Wijngaards
4260a18fb1 assertions, zero termination for gethostname, log_hex without malloc.
git-svn-id: file:///svn/unbound/trunk@679 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-16 12:26:09 +00:00
Wouter Wijngaards
8f8627a0c3 unbound-checkconf.
git-svn-id: file:///svn/unbound/trunk@647 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-26 13:39:49 +00:00
Wouter Wijngaards
6a482dc7f2 fixup test.
git-svn-id: file:///svn/unbound/trunk@645 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-26 11:15:42 +00:00
Wouter Wijngaards
bc9f482b2a syslog feature.
git-svn-id: file:///svn/unbound/trunk@644 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-26 10:19:28 +00:00
Wouter Wijngaards
553ebaf7a9 argument format.
git-svn-id: file:///svn/unbound/trunk@631 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-21 14:35:07 +00:00
Wouter Wijngaards
e4aa70b4c5 key prime, DS test.
git-svn-id: file:///svn/unbound/trunk@525 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-16 09:33:35 +00:00
Wouter Wijngaards
8a290f6a16 Fixup parser, new test.
git-svn-id: file:///svn/unbound/trunk@517 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-14 15:33:07 +00:00