[TYPO3-v4] Harmonizing severity levels

François Suter fsu-lists at cobweb.ch
Sat Nov 6 23:01:15 CET 2010


Hi,

> Yes, that's what I meant by "make devlog extension a syslog" extension,
> because sysLog() allows hooks like devLog() does.
>
> No "newby" knows that there *is* a sysLog which might contain useful
> information, because it is very ugly and non-TYPO3ish to configure (PHP
> error_log?? Unix syslog? which "regular user" knows about those?). But
> lots of Core functions use sysLog() to log very important information.

You may be surprised, but actually it's so non-TYPO3ish that I don't use 
it all. I have no idea what TYPO3 logs to the sysLog... I guess the 
thing is that I discovered the devLog early on and just used it for all 
my needs.

> You should disable writelog logging in TCEmain before starting a batch
> import: $tce->enableLogging = FALSE;

Thanks for the tip ;-) That's the problem with all those classes that 
don't have a proper API, it makes it even harder to know all their 
capabilities, because you would have to look at every member variable on 
top of looking at all methods.

> Exactly. sys_log is what the admin / user needs and uses.

But ideally it should also converge with any central logging mechanism 
(not that I didn't say "be merged", but definitely converge as much as 
possible).

> Yes, don't get me wrong, but I find devLog as redundant. Its just that
> is contains more features, but why not bundle all together?

Sure.

> Yes, that is what I call "nicer".

Ah, ok. :-)

> See what I mean. :) There is not even an official recommendation on
> where and how to log. TYPO3 should have a logging documentation or get
> rid of that many possibilities.

Indeed it is definitely a mess.

> I thought to just use t3lib_div::sysLog, because its there already, it
> is being used, it already interfaces to "file" and "syslog()" by default
> and it is hookeable just like devLog() also is.

As I already mentioned, I think the advantage of having a new method is 
that the existing ones can map between the severity levels (which may 
well change) and can also be marked as deprecated.

What's more if we move it to a new logging class, it helps trim down 
t3lib_div.

> Not really, because you need to switch realUrls "enableDevLog" (ext
> manager) ON *and* have DLOG activated before it starts logging. This is
> differnet in the auth-services, because those are logged in any case as
> soon as you activate DLOG.

OK, sorry, I remembered wrongly.

> Another reason to make this more generic and a central logging interface
> which is known to everybody and which could decide which logs from which
> extensions in which severities should go *where* (database, mail, file,
> SMS alert, ...).

Definitely.

> And for the "database" part, we could re-use lots of the interface
> "devlog" extension is currently providing.

Yes.

> And if we end up with the nice feature of sys_log which is to provide
> *translations* for log messages, we might even integrate this also in
> this central logging routine.

Yes, that would be very nice. And can probably be improved compared to 
how sys_log works currently.

Cheers

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch


More information about the TYPO3-project-v4 mailing list