|
Boost : |
From: Spencer.Collyer_at_[hidden]
Date: 2005-05-20 03:04:42
Hello John
The situation we have here for logging is as follows:
a) All logging goes via a Logger singleton.
b) The output destination of the Logger is configurable at runtime. We
currently have LogOutputters for file, console, and network. These
LogOutputters are roughly equivalent to your appenders.
c) All log messages belong to a particular topic. Topics are arranged
hierarchically, which is important when considering log levels.
d) All log messages also have a particular log level. These range from
'CRITICAL' all the way down to 'DEBUG4' (yes, we have four different
levels of debug messages). Log levels and log topics are orthogonal to
each other.
e) A particular log topic can have a minimum log level specified, and
any messages on that topic with levels below that level will not be
logged. If a log topic does not have a level explicitly set, it inherits
its level from its parent in the hierarchy, working its way up the tree
until it finds a topic that has a level set. Hence, topic
'/sm/message/builder' will inherit from '/sm/message', and if that has
no level set then they both inherit from '/sm'. The root topic always
has a level specified, even if it is the default of 'INFO'. Note that in
our scheme it is impossible to turn off CRITICAL messages.
f) We have a defined 'syslog' log level. All messages of that level and
above are sent to the syslog, even if they are turned off for their
topic.
g) Log messages are sent to the LogOutputters in a structured format,
with date/time, pid/tid, topic, level, and message all seperate. The
LogOutputters determine how these values are formatted.
h) We have the ability to adjust log levels by topic while a program is
running.
i) As a corollary to (h), and in contrast to what a lot of people have
said, we do *not* turn off logging in our production code. However, note
that all our programs are strictly 'in-house' so this is probably an
unusual requirement.
j) We do not do any kind of log rotation within the logging system
itself. However, we do have external programs that rotate logs for us on
a daily basis, and our file LogOutputter has the ability to insert a
timestamp into a logfile name or append rather than overwrite on
startup.
Spencer
------------------------------------------------------------------------
For more information about Barclays Capital, please
visit our web site at http://www.barcap.com.
Internet communications are not secure and therefore the Barclays
Group does not accept legal responsibility for the contents of this
message. Although the Barclays Group operates anti-virus programmes,
it does not accept responsibility for any damage whatsoever that is
caused by viruses being passed. Any views or opinions presented are
solely those of the author and do not necessarily represent those of the
Barclays Group. Replies to this email may be monitored by the Barclays
Group for operational or business reasons.
------------------------------------------------------------------------
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk