Comments inline.
-Sanjit
On Jul 17, 2009, at 7:45 AM, Phoenix wrote:
>
> 1. At present, the time field of the log is very hard to read. It's
> unreadable at some point.
> eg. 1247799471 INFO Hypertable.Master :
>
> There're some configurable options that can opt the output string.
> eg:
>
> diff --git a/src/cc/Common/Logger.cc b/src/cc/Common/Logger.cc
> index 301a2d1..985f231 100644
> --- a/src/cc/Common/Logger.cc
> +++ b/src/cc/Common/Logger.cc
> @@ -28,6 +28,7 @@
> #include <log4cpp/Layout.hh>
> #include <log4cpp/NDC.hh>
> #include <log4cpp/Priority.hh>
> +#include <log4cpp/PatternLayout.hh>
>
> #include "Logger.h"
>
> @@ -127,8 +128,8 @@ void
> Logger::initialize(const String &name, int priority, bool
> flush_per_log,
> std::ostream &out) {
> appender = new FlushableOstreamAppender("default", out,
> flush_per_log);
> - Logging::Layout* layout = new Logging::BasicLayout();
> - //Logging::Layout* layout = new MicrosecondLayout();
> + Logging::PatternLayout* layout = new Logging::PatternLayout();
> + layout->setConversionPattern("[%d{%Y-%m-%d %H:%M:%S}] %p %c %x: %m
> %n");
> appender->setLayout(layout);
> logger = &(Logging::Category::getInstance(name));
> logger->addAppender(appender);
>
>
> After this mod, the output string is much better. eg:
> [2009-07-17 14:53:57] INFO Hypertable.RangeServer :
>
Thanks, this should be useful to a lot of users.
> 2. Besides, log should support rolling. At present, the log files'll
> grow very large as time goes.
Currently we use cronolog for log rolling, for instance start the
rangeserver thus:
$HYPERTABLE_HOME/bin/Hypertable.RangeServer \
--pidfile=$PIDFILE --verbose "$@" '2>&1' $LOGGER &> /dev/null &
where LOGGER="| cronolog --link $LOGFILE \
$HYPERTABLE_HOME/log/archive/%Y-%m/%d/Hypertable.RangeServer.log"
This is all in the script $HYPERTABLE_HOME/bin/start-rangeserver.sh,
so if you have cronolog installed
and in your path it should just work out of the box.
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Hypertable Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/hypertable-dev?hl=en
-~----------~----~----~----~------~----~------~--~---