[TYPO3-v4] Harmonizing severity levels

Ernesto Baschny [cron IT] ernst at cron-it.de
Fri Nov 5 17:03:50 CET 2010


François Suter schrieb am 05.11.2010 09:38:
> Hi all,
> 
> I've started working on the "devlog" extension again. One thing I meant
> to do was to harmonize the severity levels with those used in
> FlashMessages, but this is far from trivial as those levels don't
> correspond at all. See the devlog's bugtracker entry for an overview:
> 
> http://forge.typo3.org/issues/10638
> 
> I would quite like to have your opinion on the issue. Do you think it's
> worth the effort? What should be done exactly? It's of course possible
> to adjust all t3lib_div::devLog calls in the Core, but what about
> extensions?

FlashMessages
---------------

I think changing the order and integers for the FlashMessage status
should be trivial, because they are "new", their order sucks anyway and
anybody who has used it will have used it using the constants, so the
integers behind it are "safe". And I don't see any particular
"filtering" based on the importance being done in FlashMessages, they
are only different codes to generate different colored warning boxes.

=> +1 on changing them like proposed in the attached patch (not tested
yet, thou... :) )

We have sysLog!
-----------------

But try to keep in mind that in TYPO3 core we have sysLog(), which is
probably what people are confusing when trying to find the "right set"
of severities, comparing with Unix syslog and Log4j:

                // Severity constants used by t3lib_div::sysLog()
        const SYSLOG_SEVERITY_INFO = 0;
        const SYSLOG_SEVERITY_NOTICE = 1;
        const SYSLOG_SEVERITY_WARNING = 2;
        const SYSLOG_SEVERITY_ERROR = 3;
        const SYSLOG_SEVERITY_FATAL = 4;

devLog() doesn't need to have this complexity. Its a "developer log"
which sounds to me that it is required only during development or for
debugging purposes. Its already very confusing for a developer to
understand when to use devLog and when sysLog, more confusing because
both allow similar severities.

An admin / developer enables DLOG in Install Tool only while trying to
figure out why something doesn't work or while developing their
extension. I usually use devLog as a "nicer way" to "debug()".

Only in "sysLog" (which is always *on*, when properly configured and
doesn't require extra extensions) it does make sense to differentiate
"ERROR" and "FATAL".

=> If an extension (or some core component) encounters an error, it
should not use devLog to report it!!! It should log to sysLog, else only
developers will see the error.


My ideal world
-----------------

I personally would prefer to have one single "logging" interface: "sysLog":

- adding a SYSLOG_SEVERITY_DEBUG = -1
- transform the "devlog" extension into a general "syslog" extension
- integrate it into core as a sysext.

Its a shame that several TYPO3 installations doesn't even know about
sysLog because it is not configured by default.


userAuth logging
------------------

BTW: I find it silly that our core authentication services activate
their devLog calls when DLOG is enabled. Usually these userauth devlogs
are only interesting if you are trying to debug some authentication
mechanism and there is already a SC_OPTIONS to activate it. See attached
patch #1, maybe others have a similar feeling.


Cheers,
Ernesto
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: t3lib_message_severities.diff
URL: <http://lists.typo3.org/pipermail/typo3-project-v4/attachments/20101105/feec1999/attachment.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: t3lib_userauth_nodevlog.diff
URL: <http://lists.typo3.org/pipermail/typo3-project-v4/attachments/20101105/feec1999/attachment.txt>


More information about the TYPO3-project-v4 mailing list