diff options
| -rw-r--r-- | htroot/ViewLog_p.html | 2 | ||||
| -rw-r--r-- | htroot/ViewLog_p.java | 5 | ||||
| -rw-r--r-- | source/de/anomic/server/logging/GuiHandler.java | 4 |
3 files changed, 9 insertions, 2 deletions
diff --git a/htroot/ViewLog_p.html b/htroot/ViewLog_p.html index 3025671c4..c73e20196 100644 --- a/htroot/ViewLog_p.html +++ b/htroot/ViewLog_p.html @@ -11,7 +11,7 @@ <form action="ViewLog_p.html" method="get" >
<fieldset>
- <input type="text" name="lines" id="lines" size ="4" value="#[lines]#" maxlength="9" /><label for="lines"> Lines</label>
+ <input type="text" name="lines" id="lines" size ="4" value="#[lines]#" maxlength="9" /><label for="lines"> Lines (max. #[maxlines]#)</label>
<input type="checkbox" name="mode" id="mode" value="reversed" #(reverseChecked)#::checked="checked"#(/reverseChecked)# /><label for="mode">reversed order</label>
<input type="text" name="filter" id="filter" size ="30" value="#[filter]#" maxlength="60" />
<input type="submit" value="refresh" />
diff --git a/htroot/ViewLog_p.java b/htroot/ViewLog_p.java index a45e3c129..7da3632e0 100644 --- a/htroot/ViewLog_p.java +++ b/htroot/ViewLog_p.java @@ -64,7 +64,7 @@ public class ViewLog_p { serverObjects prop = new serverObjects();
String[] log = new String[0];
boolean reversed = false;
- int lines = 200;
+ int maxlines = 400, lines = 200;
String filter = ".*.*";
if(post != null){
@@ -85,6 +85,8 @@ public class ViewLog_p { boolean displaySubmenu = false;
for (int i=0; i<handlers.length; i++) {
if (handlers[i] instanceof GuiHandler) {
+ maxlines = ((GuiHandler)handlers[i]).getSize();
+ if (lines > maxlines) lines = maxlines;
log = ((GuiHandler)handlers[i]).getLogLines(reversed,lines);
} else if (handlers[i] instanceof LogalizerHandler) {
displaySubmenu = true;
@@ -94,6 +96,7 @@ public class ViewLog_p { prop.put("submenu", (displaySubmenu) ? 1 : 0);
prop.put("reverseChecked", reversed ? 1 : 0);
prop.put("lines", lines);
+ prop.put("maxlines",maxlines);
prop.put("filter", filter);
// trying to compile the regular expression filter expression
diff --git a/source/de/anomic/server/logging/GuiHandler.java b/source/de/anomic/server/logging/GuiHandler.java index cc77ce99b..3a1da0b85 100644 --- a/source/de/anomic/server/logging/GuiHandler.java +++ b/source/de/anomic/server/logging/GuiHandler.java @@ -131,6 +131,10 @@ public class GuiHandler extends Handler{ this.count = 0;
}
+ public int getSize() {
+ return this.size;
+ }
+
public synchronized void publish(LogRecord record) {
if (!isLoggable(record)) return;
|
