You could also log to syslog, which is standard of logging for quite a while... Windows has a similar solution.
Headers shouldn't be messed with. Firebug is known for causing problems due to the large header sizes. Besides that, is using "X-" for headers deprecated behaviour, see: http://www.ietf.org/rfc/rfc6648.txt
@matthewbj The performance optimisation is to not use it at all when not doing debugging. This trick is the equivalent of peppering console.log calls in JS: it's highly inefficient but very useful when doing quick checks. If you want a long-term debug log solution, look into proper logging (to file or tty or socket) so you don't mix things in the output.