[TYPO3-core] RFC: error logging for the Core

Michael Stucki michael at typo3.org
Fri Jan 6 12:38:51 CET 2006


Repost for Martin.

- michael

Michael Stucki wrote:

> Hi Martin,
> 
> thanks for writing this patch - I really like the feature, and now we can
> start to use it wherever it could be useful (e.g. if a visitor sees a
> "could not connect to database" message).
> 
>> Solution: Add a system logging to t3lib_div. The first implementation
>> uses a file configured via TYPO3_CONF_VARS. The second uses PHP's
>> error_log.
> 
> I have a third option! Use the syslog() function and let syslogd decide.
> 
> Well, all of those solutions would be nice, and it's hard for me to say
> which one is the best solution. Nice that you already added a hook for
> this instead! Bad that you perform the default log operation before
> checking for the hook (IMHO it should simply replace the built-in
> functionality).
> 
> I prefer these solutions in the following order:
> 
> 1. Write the file manually:
>    Works everywhere just out-of-the box.
> 
> 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.
> 
> 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.
> 
> I don't see a need for having the error_log() solution implemented in the
> core, but I think that 1) and 2) can both be implemented at the same time:
> 
> $TYPO3_CONF_VARS['SYS']['syslog'] = '/var/log/typo3.log';
> 
> => Log into <filename> using fwrite()
> 
> $TYPO3_CONF_VARS['SYS']['syslog'] = 'syslog:local5';
> 
> => Log via syslog() by setting the facility level to LOG_LOCAL5 first.
> 
>> In config_default.php a default to typo3conf/system.log could be set. An
>> idea for a hook extension is to use syslog() directly or do some fancy
>> custom logging (eg mailing the message).
> 
> Having a default is a very bad solution! Reason: Everyone can check how
> good the site of agency xy or competitor yz is working. Same like access
> statistics that should not be publically viewable.
> 
> I think the patch is a good start but it definitely needs some
> changes/discussions before it enters the core. However, having this ready
> in 4.0 would be really great!
> 
> Regards, michael

-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/



More information about the TYPO3-team-core mailing list