Permalink
Browse files

Selective logging

  • Loading branch information...
1 parent 7059479 commit 001553e8487f2e11610d29529f0bdbf3228f4400 Egil Moeller committed Feb 2, 2011
@@ -13,6 +13,7 @@ etherpad.SQL_USERNAME = __dbc_dbuser__
hidePorts = false
listen = 9000
logDir = /var/log/etherpad
+logExclude = no-events
modulePath = ./src
motdPage = /ep/pad/view/ro.3PfHCD0ApLc/latest?fullScreen=1&slider=0&sidebar=0
topdomains = __db_topdomains__,localhost,localhost.localdomain
@@ -71,6 +71,20 @@ object config {
@ConfigParam("Directory to use for storing appserver logs. Defaults to [appjetHome]/log/appserver")
{ val argName = "directory" }
def logDir = stringOrElse("logDir", "[appjetHome]/log/appserver");
+
+ @ConfigParam("Bla bla")
+ { val argName = "" }
+ def logInclude = stringOrElse("logInclude", "");
+
+ @GeneratedConfigParam
+ def logIncludeLst = if (logInclude != "") logInclude.split(",") else null;
+
+ @ConfigParam("Bla bla")
+ { val argName = "" }
+ def logExclude = stringOrElse("logExclude", "");
+
+ @GeneratedConfigParam
+ def logExcludeLst = if (logExclude != "") logExclude.split(",") else null;
@ConfigParam("Optional alternative directory to load built-in libraries from. Used by AppJet platform hackers to develop and debug built-in libraries. Default: use built-in libraries.")
{ val argName = "directory" }
@@ -266,22 +266,27 @@ class GenericLogger(path: String, logName: String, rotateDaily: Boolean) {
}
def start() {
- initLogWriter(new Date());
-
- loggerThread = new Thread("GenericLogger "+logName) {
- this.setDaemon(true);
- override def run() {
- while (true) {
- if (queue.isEmpty()) {
- Thread.sleep(500);
- } else {
- flush(1000);
- }
- }
+ if ( ( config.logIncludeLst != null
+ && config.logIncludeLst.indexOf(logName) != -1)
+ || ( config.logExcludeLst != null
+ && config.logExcludeLst.indexOf(logName) == -1)) {
+ initLogWriter(new Date());
+
+ loggerThread = new Thread("GenericLogger "+logName) {
+ this.setDaemon(true);
+ override def run() {
+ while (true) {
+ if (queue.isEmpty()) {
+ Thread.sleep(500);
+ } else {
+ flush(1000);
+ }
+ }
+ }
}
+ main.loggers += this;
+ loggerThread.start();
}
- main.loggers += this;
- loggerThread.start();
}
def log(lpb: LoggablePropertyBag) {

0 comments on commit 001553e

Please sign in to comment.