Electrolysis/Logging

From MozillaWiki
Jump to: navigation, search

Logging Support

  • need to sort out current state of MOZ logging and other forms of IPC related logging
  • Sandboxing. Approaches to writing log files from sandboxed child processes include:
    • Open files early, either during startup or from a sandboxing-specific hook, rather than opening lazily on first use. Not ideal for log files that might not be used at all.
    • Have the parent open file descriptors and send them to the child; see PCycleCollectWithLogs for one example. Works well with code using stdio or NSPR, and less well with C++ iostreams. Especially good for high-volume data, because writes go directly to the file and the OS handles buffering.
    • Send the data in chunks over IPC messages (e.g., using bug 1093357 once that lands); note that Gecko IPC has no flow control, so OOM is a possibility if the receiver can't keep up. Also problematic if logging is to be done from multiple threads. However, this approach would also work for JS code using MessageManager, whereas IPC FileDescriptor passing is only usable by C/C++.
  • Logging.h
  • bug 881389 (OneLogger) Improve Gecko's logging story

Open Bugs

  • bug 1272704 NSPR logging appears to be broken on Windows from Content processes
  • bug 1014407 Failure when setting stdout or stderr on the Windows process sandboxing policy should be reported as a warning
  • bug 1055227 Make sandbox logging (security/sandbox/chromium/base/shim/base/logging*) actually emit log messsages
  • bug 1198475 Mochitest log file opened directly in content process