[TYPO3-core] RFC: error logging for the Core
Martin Kutschker
Martin.Kutschker at blackbox.net
Fri Jan 6 12:31:37 CET 2006
Karsten Dambekalns <karsten at typo3.org> writes on
Thu, 05 Jan 2006 20:19:26 +0100 (MET):
> Hi.
>
> On Wednesday 04 January 2006 23:58, Michael Stucki wrote:
>
Odd. Either I didn't get Michael's mail or I deleted it accidentally.
> > instead! Bad that you perform the default log operation before
> > checking for the hook (IMHO it should simply replace the built-in
> > functionality).
>
> +1
The default operation is configurable (and has to be turned on manually), so you can use the default and any custim logging.
> > I prefer these solutions in the following order:
There is little consenus here :-(
Anyway, my patch had no default order at all. The if/ifelse part only evaluated the config option.
> >
> > 1. Write the file manually:
> > Works everywhere just out-of-the box.
Is the same as error_log with type=4, but has the drawback that we have to rely on advisory file locking.
I should have never brought this up.
> > 2. Call syslog()
> > I can setup syslog to log TYPO3 messages into a separate logfile
> > - no
> > TYPO3 involved, only the facility that needs to be configured
> > through TYPO3_CONF_VARS.
You can configure PHP to use syslog with error_log, but it could be an extra option.
> > 3. Use error_log()
> > In my opinion, error_log() is probably useful for short time
> > debugging, but it is not helpful to be used as a permanent system
> > log because of endless-repeating syntax error reports.
error_log has 3 methods of logging, but well.
> Either way, it would be nice to have this, but it will only be really
> useful, if it widely deployed throughout the core (and extensions).
I see. For normal cases they could use the devLog. So perhaps the new should be constrained to (fatal) errors.
* rename it from sysLog() to errLog()
* remove the severity argument
The attached patch implements this.
The log is configured via $TYPO3_CONF_VARS['SYS']['errorLog']
The manifold options for anyones preferences are:
file:/path/to/log/file
mail:user at domain.tld
syslog
error_log:system
error_log:user at domain.tld
error_log:/path/to/log/file
The syslog options needs a openlog() which I have ommited in this patch. It should be opened early in the code (both BE and FE).
Normally it should use this ident:
t3lib_div::getIndpEnv('TYPO3_REQUEST_HOST')
What to use in CLI mode? The TYPO3 path?
if ($TYPO3_CONF_VARS['SYS']['errorLog'] === 'syslog') {
define_syslog_variables();
openlog($ident,LOG_ODELAY,LOG_USER);
}
Masi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-diff
Size: 2326 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060106/17e5a75f/attachment.bin
More information about the TYPO3-team-core
mailing list