]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common: make command-line programs log to stderr
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 5 Jan 2011 19:04:49 +0000 (11:04 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 5 Jan 2011 23:53:36 +0000 (15:53 -0800)
commit8adaa0478a94b5f731ee77e12a8dac29e3a7b46a
tree9ee979769de1ced08700a849c2a889ed7c7c8d20
parentbba356b86641085aeb8b76cea3526622265bf387
common: make command-line programs log to stderr

command-line programs (as opposed to daemons) should send their logs to
stderr rather than to a log file, syslog, etc. This is especially
important because most users want to run the ceph command-line programs
as non-root, and often only root has permissions to add to the ceph
log directory.

Create a new function, set_foreground_logging, that overrides ceph.conf
settings to force all log output to stderr. For daemons, we still only
send the very highest priority messages to stderr, and only before they
daemonize().

Don't ever log to stdout because it interferes with scripts that parse
the output of stdout. Instead, log to stderr if the user gives the
--foreground or --nodaemon argument.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
29 files changed:
src/cauthtool.cc
src/cconf.cc
src/common/DoutStreambuf.cc
src/common/DoutStreambuf.h
src/common/common_init.cc
src/common/common_init.h
src/common/debug.cc
src/common/debug.h
src/config.cc
src/config.h
src/crushtool.cc
src/csyn.cc
src/dumpjournal.cc
src/dupstore.cc
src/fakefuse.cc
src/fakesyn.cc
src/osdmaptool.cc
src/rados.cc
src/rbd.cc
src/rgw/rgw_admin.cc
src/streamtest.cc
src/test/TestDoutStreambuf.cc
src/test/TestEncoding.cc
src/test/TestSignalHandlers.cc
src/test/TestTimers.cc
src/test_trans.cc
src/testmsgr.cc
src/tools/ceph.cc
src/tools/gceph.cc