# File lib/swiftcore/Analogger.rb, line 31
      def start(config,protocol = AnaloggerProtocol)
        @config = config
        daemonize if @config[-"daemonize"]
        File.open(@config[-"pidfile"],-"w+") {|fh| fh.puts $$} if @config[-"pidfile"]
        @logs = Hash.new {|h,k| h[k] = new_log(k)}
        @queue = Hash.new {|h,k| h[k] = []}
        postprocess_config_load
        check_config_settings
        populate_logs
        set_config_defaults
        @rcount = 0
        @wcount = 0
        @server = nil
        safe_trap(EXIT_SIGNALS) {handle_pending_and_exit}
        safe_trap(RELOAD_SIGNALS) {cleanup_and_reopen}
        safe_trap(RESTART_SIGNALS) {exec(*EXEC_ARGUMENTS)}

        #####
        # This is gross.  EM needs to change so that it defaults to the faster
        # platform specific methods, allowing the user the option to downgrade
        # to a simple select() loop if they have a good reason for it.
        #
        EventMachine.epoll rescue nil
        EventMachine.kqueue rescue nil
        #
        # End of gross.
        #
        # TODO: The above was written YEARS ago. See if EventMachine is smarter, now.
        #####

        EventMachine.set_descriptor_table_size(4096)
        EventMachine.run {
          EventMachine.add_shutdown_hook do
            write_queue
            flush_queue
            cleanup
          end
          @server = EventMachine.start_server @config[-"host"], @config[-"port"], protocol
          EventMachine.add_periodic_timer(1) {Analogger.update_now}
          EventMachine.add_periodic_timer(@config[-"interval"]) {write_queue}
          EventMachine.add_periodic_timer(@config[-"syncinterval"]) {flush_queue}
        }
        exit
      end