New: syslog is configured on document directory by default. This make enabled module easier for unexperienced users.

This commit is contained in:
Laurent Destailleur
2008-04-19 20:57:29 +00:00
parent 3994341a3c
commit c5898b74b0
4 changed files with 10 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2007 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* This program is free software; you can redistribute it and/or modify
@@ -52,8 +52,6 @@ if ($_POST["action"] == 'set')
dolibarr_del_const($db,"SYSLOG_FILE");
dolibarr_set_const($db,"SYSLOG_FACILITY",$_POST["facility"]);
dolibarr_syslog("admin/syslog: facility ".$_POST["facility"]);
Header("Location: syslog.php");
exit;
}
else
{
@@ -89,6 +87,7 @@ $def = array();
$syslogfacility=$defaultsyslogfacility=dolibarr_get_const($db,"SYSLOG_FACILITY");
$syslogfile=$defaultsyslogfile=dolibarr_get_const($db,"SYSLOG_FILE");
if (! $defaultsyslogfacility) $defaultsyslogfacility='LOG_USER';
if (! $defaultsyslogfile) $defaultsyslogfile='dolibarr.log';

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,13 +15,11 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/
/**
\defgroup syslog Module syslog
\brief Module pour g<EFBFBD>rer les messages d'erreur dans syslog
\brief Module pour gerer les messages d'erreur dans syslog
*/
/**

View File

@@ -151,8 +151,10 @@ function dolibarr_syslog($message, $level=LOG_INFO)
if (defined("SYSLOG_FILE") && SYSLOG_FILE)
{
if (defined("SYSLOG_FILE_NO_ERROR")) $file=@fopen(SYSLOG_FILE,"a+");
else $file=fopen(SYSLOG_FILE,"a+");
$filelog=SYSLOG_FILE;
$filelog=eregi_replace('DOL_DATA_ROOT',DOL_DATA_ROOT,$filelog);
if (defined("SYSLOG_FILE_NO_ERROR")) $file=@fopen($filelog,"a+");
else $file=fopen($filelog,"a+");
if ($file)
{
$ip='unknown_ip';
@@ -178,7 +180,7 @@ function dolibarr_syslog($message, $level=LOG_INFO)
elseif (! defined("SYSLOG_FILE_NO_ERROR"))
{
$langs->load("main");
print $langs->trans("ErrorFailedToOpenFile",SYSLOG_FILE);
print $langs->trans("ErrorFailedToOpenFile",$filelog);
}
}
else

View File

@@ -60,6 +60,7 @@ insert into llx_const (name, value, type, note, visible) values ('MAIN_NOT_INSTA
insert into llx_const (name, value, type, note, visible) values ('MAIN_MONNAIE','EUR','chaine','Monnaie',0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_POPUP_CALENDAR','eldy','chaine','Popup calendar module',0);
insert into llx_const(name,value,type,visible,note) values('SYSLOG_FILE','DOL_DATA_ROOT/dolibarr.log','chaine',0,'Directory where to write log file');
insert into llx_const(name,value,type,visible,note) values('SYSLOG_LEVEL','6','chaine',0,'Level of debug info to show');
insert into llx_const (name, value, type, note, visible) values ('MAIN_MAIL_SMTP_SERVER','','chaine','Host or ip address for SMTP server',0);