Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Open sidebar
Webslice
ISPConfig 3
Commits
5e9e9e9c
Commit
5e9e9e9c
authored
Mar 29, 2013
by
redray
Browse files
Module Monitor: set css class for each line of log, depending on key words in each line
parent
f061c857
Changes
2
Hide whitespace changes
Inline
Side-by-side
interface/web/monitor/show_log.php
View file @
5e9e9e9c
...
...
@@ -125,7 +125,20 @@ $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE t
if
(
isset
(
$record
[
'data'
]))
{
$data
=
unserialize
(
$record
[
'data'
]);
$logData
=
nl2br
(
htmlspecialchars
(
$data
));
$logData
=
explode
(
"
\n
"
,
htmlspecialchars
(
$data
));
$logDataHtml
=
''
;
/* set css class for each line of log, depending on key words in each line */
foreach
(
$logData
as
$val
)
{
if
(
strpos
(
$val
,
'ERROR'
)
!==
FALSE
)
{
$logDataHtml
.
=
"<div class='logerror'>
$val
</div>"
;
}
elseif
(
strpos
(
$val
,
'WARN'
)
!==
FALSE
)
{
$logDataHtml
.
=
"<div class='logwarn'>
$val
</div>"
;
}
elseif
(
strpos
(
$val
,
'INFO'
)
!==
FALSE
)
{
$logDataHtml
.
=
"<div class='loginfo'>
$val
</div>"
;
}
else
{
$logDataHtml
.
=
"<div class='log'>
$val
</div>"
;
}
}
$app
->
tpl
->
setVar
(
"log_data"
,
$logData
);
}
else
{
...
...
interface/web/themes/default/css/styles.css
View file @
5e9e9e9c
...
...
@@ -438,6 +438,9 @@ table.list .tbl_col_limit {
font-family
:
Consolas
,
"Lucida Console"
,
"Courier New"
,
monospace
;
font-size
:
0.9em
;
}
.codeview
.logerror
{
background
:
rgb
(
255
,
0
,
0
);
}
.codeview
.logwarn
{
background
:
rgb
(
255
,
204
,
0
);
}
.codeview
.loginfo
{
background
:
rgb
(
153
,
204
,
255
);
}
/* Lists */
table
.list
{
width
:
100%
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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