Commit Graph

27 Commits

Author SHA1 Message Date
Peter Palfrader
9a676b04dd Check that we can write to the logfile and log a warning to stderr if we can't
Move writing of pidfile after daemonizing, and also after setting the [ug]id:
This means that the tor user needs write priviliges to the pidfile location.
It needs it for unlinking the pidfile anyway.


svn:r846
2003-11-19 02:09:43 +00:00
Roger Dingledine
82aa621b47 rewrite close_logs so it could possibly work
remove deadbeef memory-clobber testing (for now)


svn:r616
2003-10-18 00:07:58 +00:00
Roger Dingledine
11a23fc280 clean up logging, allow user to specify log files
If DebugLogFile is specified, log to it at -l debug
If LogFile is specified, log to it at the -l from the commandline
  (default info)
If no LogFile *and* not a Daemon, then log to stdout.
Make conn->s = -1 by default (this might break things)
When kill -USR1, prefer to log at INFO, but make sure they always see it.


svn:r596
2003-10-15 18:50:16 +00:00
Nick Mathewson
22ef733058 Make add_file_log return 0 on success.
svn:r594
2003-10-15 18:38:38 +00:00
Roger Dingledine
8df0eee16a oops, bugfix
svn:r572
2003-10-10 01:50:20 +00:00
Roger Dingledine
36fb8e839d change WARNING to WARN
svn:r570
2003-10-10 01:48:03 +00:00
Nick Mathewson
36939303c9 Update LICENSE and copyright dates.
svn:r560
2003-10-08 02:04:08 +00:00
Roger Dingledine
de6cbe53c0 some early bugfixes
our log() conflicts with log(3)
distribute only the correct files from doc/ and src/config/
sometimes laptops go back in time. i guess that's ok for now.
and bump the version number because we're live.


svn:r544
2003-10-07 16:30:05 +00:00
Roger Dingledine
be874358a4 wrap strdup; prefer time() to gettimeofday()
svn:r538
2003-10-04 03:29:09 +00:00
Roger Dingledine
750b238aea clean some includes
svn:r535
2003-10-04 01:36:11 +00:00
Nick Mathewson
f694ab23f5 Flush after fputs
svn:r526
2003-10-01 00:42:24 +00:00
Roger Dingledine
f0e94dab86 make log use a larger buffer, for easier debugging
svn:r515
2003-09-30 19:53:25 +00:00
Roger Dingledine
3ed7aedc11 bugfixes and features: closer to making dirserv work
fix a variety of seg faults
don't try to list OPs in running-routers
write cached-directory to disk when rebuilding the dir
on boot, dirservers load approved-routers file
on boot, dirservers load cached directory file


svn:r508
2003-09-29 23:14:49 +00:00
Roger Dingledine
bf10a3c0f1 finish enforcing the log convention
svn:r494
2003-09-26 22:27:24 +00:00
Roger Dingledine
3b5191d36d various bugfixes and updates
redo all the config files for the new format (we'll redo them again soon)

fix (another! yuck) segfault in log_fn when input is too large
tor_tls_context_new() returns -1 for error, not NULL
fix segfault in check_conn_marked() on conn's that die during tls handshake

make ORs also initialize conn from router when we're the receiving node

make non-dirserver ORs upload descriptor to every dirserver on startup
add our local address to the descriptor
add Content-Length field to POST command
revert the Content-Length search in fetch_from_buf_http() to previous code
fix segfault in memmove in fetch_from_buf_http()
raise maximum allowed headers/body size in directory.c


svn:r484
2003-09-25 10:42:07 +00:00
Roger Dingledine
e514ac528c fix a segfault on truncated log lines
svn:r473
2003-09-19 09:30:34 +00:00
Nick Mathewson
7711c2e745 Add backend support for multiple logfiles, including console logs.
Also optimize logging by formatting messages in memory before sending
them through stdio.  (It turns out (according to gprof) that logging
performance matters.)


svn:r463
2003-09-16 17:58:36 +00:00
Nick Mathewson
5082ee8ae0 Non-debugging messages are nice to log too
svn:r444
2003-09-11 22:13:13 +00:00
Nick Mathewson
c336c99e60 Start of port to win32. Missing are:
- signal support
  - forking for DNS farm
  - changes for async IO
  - daemonizing

In other words, some files still don't build, and the ones that do build,
do nonblocking IO incorrectly.

I'm also not checking in the project files till I have a good place
for them.


svn:r380
2003-08-12 03:08:41 +00:00
Roger Dingledine
6c9e3762b5 clean up sev_to_string hack in log.c
svn:r355
2003-06-25 04:47:54 +00:00
Nick Mathewson
efbcd71b9b Remove false warnings from printf checks
svn:r340
2003-06-21 19:03:22 +00:00
Nick Mathewson
5fd033a8e8 Come up with a less macro-happy, even more portable log_fn implementation
svn:r331
2003-06-17 21:36:44 +00:00
Nick Mathewson
2b2eff33c5 Add a missing long cast to log.c for portability
svn:r199
2003-03-19 20:54:39 +00:00
Roger Dingledine
f50f35f2ec added milliseconds to log lines
svn:r139
2002-11-24 08:45:13 +00:00
Roger Dingledine
4eb0158f42 the logs now include a timestamp and severity
the implementation is sort of a kludge..you're welcome to fix it up


svn:r94
2002-09-04 00:39:33 +00:00
Bruce Montrose
be25ffd5d7 removed loglevel from global namespace. severity level is set using log() with a NULL format argument now. example: log(LOG_ERR,NULL);
svn:r44
2002-07-12 18:14:17 +00:00
Roger Dingledine
9a928eeb12 Initial revision
svn:r2
2002-06-26 22:45:49 +00:00