Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
6b91addb
Commit
6b91addb
authored
Sep 26, 2017
by
akrherz
Committed by
Guus der Kinderen
Sep 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-1380 Add all.log to Admin Console log viewer
parent
95be0a4e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
5 deletions
+27
-5
openfire_i18n_en.properties
src/i18n/openfire_i18n_en.properties
+1
-0
Log.java
src/java/org/jivesoftware/util/Log.java
+7
-0
log.jsp
src/web/log.jsp
+2
-2
logviewer.jsp
src/web/logviewer.jsp
+17
-3
No files found.
src/i18n/openfire_i18n_en.properties
View file @
6b91addb
...
...
@@ -1112,6 +1112,7 @@ login.version=Version
# Logviewer Page
logviewer.title
=
Log Viewer
logviewer.all
=
All
logviewer.error
=
Error
logviewer.warn
=
Warn
logviewer.info
=
Info
...
...
src/java/org/jivesoftware/util/Log.java
View file @
6b91addb
...
...
@@ -307,6 +307,13 @@ public class Log {
emptyFile
(
logFile
);
}
public
static
void
rotateAllLogFile
()
{
// SLF4J doesn't provide a hook into the logging implementation. We'll have to do this 'direct', bypassing slf4j.
File
logFile
=
new
File
(
Log
.
getLogDirectory
(),
"all.log"
);
emptyFile
(
logFile
);
}
/**
* Returns the directory that log files exist in. The directory name will
* have a File.separator as the last character in the string.
...
...
src/web/log.jsp
View file @
6b91addb
...
...
@@ -83,13 +83,13 @@
String
mode
=
ParamUtils
.
getParameter
(
request
,
"mode"
);
// Only allow requests for valid log file names.
if
(!(
"debug"
.
equals
(
log
)
||
"warn"
.
equals
(
log
)
||
"info"
.
equals
(
log
)
||
"error"
.
equals
(
log
)))
{
if
(!(
"debug"
.
equals
(
log
)
||
"warn"
.
equals
(
log
)
||
"info"
.
equals
(
log
)
||
"error"
.
equals
(
log
)
||
"all"
.
equals
(
log
)
))
{
log
=
null
;
}
// Set defaults
if
(
log
==
null
)
{
log
=
"
error
"
;
log
=
"
all
"
;
}
if
(
mode
==
null
)
{
mode
=
"asc"
;
...
...
src/web/logviewer.jsp
View file @
6b91addb
...
...
@@ -35,11 +35,12 @@
<%!
static
final
String
NONE
=
LocaleUtils
.
getLocalizedString
(
"global.none"
);
static
final
String
ALL
=
"all"
;
static
final
String
ERROR
=
"error"
;
static
final
String
INFO
=
"info"
;
static
final
String
WARN
=
"warn"
;
static
final
String
DEBUG
=
"debug"
;
static
final
String
DEFAULT
=
ERROR
;
static
final
String
DEFAULT
=
ALL
;
static
final
String
ASCENDING
=
"asc"
;
static
final
String
DESCENDING
=
"desc"
;
...
...
@@ -87,7 +88,7 @@
{
// Get the cookie associated with the log files
HashMap
cookie
=
parseCookie
(
CookieUtils
.
getCookie
(
request
,
"jiveforums.admin.logviewer"
));
String
[]
logs
=
{
"error"
,
"info"
,
"warn"
,
"debug"
};
String
[]
logs
=
{
"
all"
,
"
error"
,
"info"
,
"warn"
,
"debug"
};
HashMap
<
String
,
String
>
newCookie
=
new
HashMap
<
String
,
String
>
();
HashMap
<
String
,
String
>
updates
=
new
HashMap
<
String
,
String
>
();
for
(
String
log
:
logs
)
{
...
...
@@ -151,7 +152,10 @@
if
(
clearLog
&&
log
!=
null
)
{
if
(!(
csrfCookie
==
null
||
csrfParam
==
null
||
!
csrfCookie
.
getValue
().
equals
(
csrfParam
)))
{
if
(
"error"
.
equals
(
log
))
{
if
(
"all"
.
equals
(
log
))
{
Log
.
rotateAllLogFile
();
}
else
if
(
"error"
.
equals
(
log
))
{
Log
.
rotateErrorLogFile
();
}
else
if
(
"warn"
.
equals
(
log
))
{
...
...
@@ -267,6 +271,14 @@ IFRAME {
<table
cellpadding=
"0"
cellspacing=
"0"
border=
"0"
width=
"100%"
>
<tbody>
<tr>
<td
class=
"jive-spacer"
width=
"1%"
>
</td>
<td
class=
"jive-tab
<%=
((
"all"
.
equals
(
log
))?
"-active"
:
""
)
%>
"
width=
"1%"
>
<a
href=
"logviewer.jsp?log=all"
><fmt:message
key=
"logviewer.all"
/></a>
<span
class=
"new"
>
<%=
((
newlogs
.
containsKey
(
"all"
))?
"*"
:
""
)
%>
</span>
</td>
<td
class=
"jive-spacer"
width=
"1%"
>
</td>
<td
class=
"jive-tab
<%=
((
"error"
.
equals
(
log
))?
"-active"
:
""
)
%>
"
width=
"1%"
>
<a
href=
"logviewer.jsp?log=error"
...
...
@@ -383,6 +395,7 @@ IFRAME {
<a
href=
"#"
onclick=
"if (confirm('
<fmt:message
key=
"logviewer.confirm"
/>
')) {setLog('clearLog'); document.logViewer.submit(); return true;} else { return false; }"
><fmt:message
key=
"logviewer.clear"
/></a>
</td>
<%
if
(!
"all"
.
equals
(
log
))
{
%>
<td
class=
"icon"
>
<a
href=
"#"
onclick=
"setLog('markLog'); document.logViewer.submit(); return true;"
><img
src=
"images/mark-16x16.gif"
border=
"0"
alt=
"
<fmt:message
key=
"logviewer.alt_mark"
/>
"
></a>
</td>
...
...
@@ -390,6 +403,7 @@ IFRAME {
<a
href=
"#"
onclick=
"setLog('markLog'); document.logViewer.submit(); return true;"
><fmt:message
key=
"logviewer.mark"
/></a>
</td>
<%
}
%>
</tr>
</tbody>
</table>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment