mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-03 03:38:33 +08:00
Log web layer exceptions in server log file
This commit is contained in:
parent
c161aa5fb5
commit
b6e93d3e66
@ -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<LogItem> items = new LinkedList<LogItem>();
|
||||
|
||||
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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user