catalog: add logging and fix bugs

* use user-friendly messages
* fix help output

refs: #3189

Change-Id: I33dcb1a9c806d01c6665e0ef941d5b4f1d64774f
diff --git a/log4cxx.properties b/log4cxx.properties
new file mode 100644
index 0000000..3144df3
--- /dev/null
+++ b/log4cxx.properties
@@ -0,0 +1,22 @@
+# Set root logger level to DEBUG and its only appender to R.
+log4j.rootLogger=ERROR, R
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=example.log
+log4j.appender.R.MaxFileSize=100KB
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d{hh:mm:ss,SSS}  %-14t %-14c  %m%n
+
+# R is set to be a ConsoleAppender.
+#log4j.appender.R=org.apache.log4j.ConsoleAppender
+
+# R uses PatternLayout.
+#log4j.appender.R.layout=org.apache.log4j.PatternLayout
+#log4j.appender.R.target=System.err
+#log4j.appender.R.layout.ConversionPattern=%d{dd-MMM HH:MM:SS,SSS} %p %c %m%n
+#log4j.appender.R.layout.ConversionPattern=%d{hh:mm:ss,SSS} %-14t %-14c  %m%n
+#log4j.appender.R.layout.ConversionPattern=%d{ss,SSS}  %-12c  %m%n
+
+log4j.logger.QueryAdapter = DEBUG
+log4j.logger.PublishAdapter = DEBUG