From b6e93d3e6696557b8b068fdb3ddc3f0efdcc1df5 Mon Sep 17 00:00:00 2001 From: Konstantin Krivopustov Date: Thu, 12 Feb 2009 08:26:59 +0000 Subject: [PATCH] Log web layer exceptions in server log file --- modules/web/src/com/haulmont/cuba/web/log/AppLog.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/web/src/com/haulmont/cuba/web/log/AppLog.java b/modules/web/src/com/haulmont/cuba/web/log/AppLog.java index 428d80599a..9096f8c1d2 100644 --- a/modules/web/src/com/haulmont/cuba/web/log/AppLog.java +++ b/modules/web/src/com/haulmont/cuba/web/log/AppLog.java @@ -21,13 +21,20 @@ import java.util.ArrayList; import java.util.LinkedList; import java.util.List; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + public class AppLog { private LinkedList items = new LinkedList(); private int capacity = 100; + private Log log = LogFactory.getLog(AppLog.class); + public void log(LogItem item) { + log.debug(item.getLevel() + ": " + item.getMessage(), item.getThrowable()); + if (items.size() >= capacity) { items.removeLast(); }