Ticket #989 (new defect )

Opened 4 years ago

Last modified 3 years ago

Default log observer chokes on unicode messages

Reported by: exarkun Assigned to: itamarst
Type: defect Priority: high
Milestone: Component: core
Keywords: Cc: glyph, exarkun, itamarst, jknight, bruce, ralphm
Branch: Author:
Launchpad Bug:

Attachments

Change History

  2005-04-17 20:46:57+00:00 changed by exarkun

When logging a unicode message, the default log observer will raise an
exception, causing itself to be removed from the logging system.
This fact is helpfully logged so that the developer or sysadmin can rectify the
problem, only there are often no log observers left to record this message...
1) We should support unicode messages
2a) There should be an ultra-safe fallback log observer which can be used to
record things like the default log observer failing and being removed
or
2b) The default log observer should never be permanently removed, even if it
starts raising exceptions

  2005-05-28 07:16:20+00:00 changed by bruce

I see a problem similar to this, but I don't use unicode, so it isn't exactly
this.  But I do see that *something* happens, and forever after that, my
twistd.log is sadly silent.

  2005-05-28 07:57:57+00:00 changed by jknight

[21:50] <foom> the proposal was to not remove the logger, until trying to log
the exception first, and having that fail.
[21:51] <foom> as well ensuring that unicode strings in tracebacks don't screw
things up or something
[21:51] <exarkun> tracebacks shouldn't be able to be unicode
[21:51] <foom> then the first should fix it
[21:51] <exarkun> of course that is only a moral stance, I don't know if it is
true
[21:52] <foom> Removing the logger because the logged item is defective is
wrong, so that's the first thing that should be fixed.
[21:52] <exarkun> Eh
[21:52] <exarkun> That's a funny way of looking at it.
[21:52] <foom> Well, if logging the exception raised when trying to log works,
nothing needs to be removed.
[21:53] <foom> because the system is still in a workable state.
[21:53] <exarkun> right, it seems like it should work
[21:53] <exarkun> it's just seems funny :)
[21:53] <foom> if this proposal isn't in the bug report yet someone should add
it.

  2005-05-31 07:59:29+00:00 changed by exarkun

Something of a fix committed at r13877.  This was not the fix discussed below,
because there are so many ugly cases handled in the code right now, it would
have been too difficult to implement.
As a long term solution, all of the stupid misfeatures of log.msg() should be
deprecated and well specified features added in their place (including unicode
support and interface-based observer delegation).

  2005-06-01 22:04:14+00:00 changed by bruce

My bug was something different and is now filed as issue #1069.
Note: See TracTickets for help on using tickets.