Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISPConfig
ISPConfig 3
Commits
d7f14d3f
Commit
d7f14d3f
authored
Dec 09, 2008
by
tbrehm
Browse files
enable ispconfig logging in database.
parent
b7c43a6d
Changes
6
Show whitespace changes
Inline
Side-by-side
interface/lib/classes/listform.inc.php
View file @
d7f14d3f
...
...
@@ -38,7 +38,7 @@ class listform {
private
$pagingValues
;
private
$searchChanged
=
0
;
private
$module
;
private
$dateformat
=
'
d.m.Y
'
;
private
$dateformat
=
'
Y-m-d H:i
'
;
public
$wordbook
;
public
function
loadListDef
(
$file
,
$module
=
''
)
...
...
interface/web/admin/list/datalog.list.php
View file @
d7f14d3f
...
...
@@ -45,8 +45,8 @@ $liste['auth'] = 'no';
*****************************************************/
$liste
[
"item"
][]
=
array
(
'field'
=>
"tstamp"
,
'datatype'
=>
"
VARCHAR
"
,
'formtype'
=>
"
DA
TE"
,
'datatype'
=>
"
DATE
"
,
'formtype'
=>
"TE
XT
"
,
'op'
=>
"like"
,
'prefix'
=>
""
,
'suffix'
=>
""
,
...
...
interface/web/admin/list/log.list.php
View file @
d7f14d3f
...
...
@@ -45,8 +45,8 @@ $liste['auth'] = 'no';
*****************************************************/
$liste
[
"item"
][]
=
array
(
'field'
=>
"tstamp"
,
'datatype'
=>
"
VARCHAR
"
,
'formtype'
=>
"
DA
TE"
,
'datatype'
=>
"
DATE
"
,
'formtype'
=>
"TE
XT
"
,
'op'
=>
"like"
,
'prefix'
=>
""
,
'suffix'
=>
""
,
...
...
interface/web/admin/templates/datalog_list.htm
View file @
d7f14d3f
...
...
@@ -26,14 +26,14 @@
<tbody>
<tmpl_loop
name=
"records"
>
<tr
class=
"tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>"
>
<td
class=
"tbl_col_tstamp"
>
<a
href=
"#"
onClick=
"loadContent('admin/datalog_edit.php?id={tmpl_var name='id'}');"
>
{tmpl_var name="tstamp"}
</
a></
td>
<td
class=
"tbl_col_server_id"
>
<a
href=
"#"
onClick=
"loadContent('admin/datalog_edit.php?id={tmpl_var name='id'}');"
>
{tmpl_var name="server_id"}
</
a></
td>
<td
class=
"tbl_col_action"
>
<a
href=
"#"
onClick=
"loadContent('admin/datalog_edit.php?id={tmpl_var name='id'}');"
>
{tmpl_var name="action"}
</
a></
td>
<td
class=
"tbl_col_dbtable"
>
<a
href=
"#"
onClick=
"loadContent('admin/datalog_edit.php?id={tmpl_var name='id'}');"
>
{tmpl_var name="dbtable"}
</
a></
td>
<td
class=
"tbl_col_status"
>
<a
href=
"#"
onClick=
"loadContent('admin/datalog_edit.php?id={tmpl_var name='id'}');"
>
{tmpl_var name="status"}
</
a></
td>
<td
class=
"tbl_col_tstamp"
>
{tmpl_var name="tstamp"}
</td>
<td
class=
"tbl_col_server_id"
>
{tmpl_var name="server_id"}
</td>
<td
class=
"tbl_col_action"
>
{tmpl_var name="action"}
</td>
<td
class=
"tbl_col_dbtable"
>
{tmpl_var name="dbtable"}
</td>
<td
class=
"tbl_col_status"
>
{tmpl_var name="status"}
</td>
<td
class=
"tbl_col_buttons"
>
<div
class=
"buttons icons16"
>
<a
class=
"icons16 icoDelete"
href=
"javascript: del_record('admin/datalog_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"
><span>
{tmpl_var name='delete_txt'}
</span></a>
<!--
<a class="icons16 icoDelete" href="javascript: del_record('admin/datalog_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span>{tmpl_var name='delete_txt'}</span></a>
-->
</div>
</td>
</tr>
...
...
server/cron_daily.php
View file @
d7f14d3f
...
...
@@ -125,9 +125,18 @@ foreach($records as $rec) {
}
}
#######################################################################################################
// Cleanup logs in database
#######################################################################################################
//* Keep 7 days in sys_log
$tstamp
=
time
()
-
(
60
*
60
*
24
*
7
);
$sql
=
"DELETE FROM sys_log WHERE tstamp <
$tstamp
"
;
$app
->
db
->
query
(
$sql
);
//* Keep 7 days in sys_datalog
$tstamp
=
time
()
-
(
60
*
60
*
24
*
7
);
$sql
=
"DELETE FROM sys_datalog WHERE tstamp <
$tstamp
"
;
$app
->
db
->
query
(
$sql
);
die
(
"finished.
\n
"
);
...
...
server/lib/app.inc.php
View file @
d7f14d3f
...
...
@@ -126,6 +126,14 @@ class app {
echo
date
(
"d.m.Y-H:i"
)
.
" - "
.
$priority_txt
.
" - "
.
$msg
.
"
\n
"
;
fclose
(
$fp
);
// Log to database
$server_id
=
$conf
[
'server_id'
];
$loglevel
=
$priority
;
$tstamp
=
time
();
$message
=
$app
->
db
->
quote
(
$msg
);
$sql
=
"INSERT INTO sys_log (server_id,loglevel,tstamp,message) VALUES ('
$server_id
','
$loglevel
','
$tstamp
','
$message
')"
;
$app
->
db
->
query
(
$sql
);
//} else {
// die("Unable to write to logfile.");
//}
...
...
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