Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6914033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:17:45+00:00 2026-05-27T09:17:45+00:00

socket.io seems to have a basically sensible logging system for all its internals. How

  • 0

socket.io seems to have a basically sensible logging system for all its internals. How do I get at that logging object myself so I can generate my own log messages at appropriate levels? It bugs me that my console.log() messages are un-timestamped, un-leveled, and ugly next to the socket.io messages. I’ve done a bunch of spelunking in the socket.io code and I’m just not savvy enough about node at this point to understand what the object hierarchies look like to know how to get at the object I want from my code.

Longer term, I’m probably going to want a more robust logging system module (with the ability to log to files, auto-rotate, manage levels on a per-module basis, custom log levels, etc.). Winston looks sensible, but can I get socket.io to use it, too? It’d be nice to have everything in one place.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:17:45+00:00Added an answer on May 27, 2026 at 9:17 am

    While using socket.io, I was able to plug into the existing logger module like so:

    var express = require('express'),
        app     = module.exports = express.createServer(), //just creating 'app' for io
        io      = require('socket.io').listen(app),
        logger  = io.log, // access the existing logger setup in socket.io
        util    = require('util');
    
    logger.info(util.format("Express server listening on port %d in %s mode", 8003, app.settings.env));
    

    Configuring the logger is also very simple:

    io.configure('production', function(){
      io.set('log level', 1);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a stream of bytes that is being read in from a socket
I have a .NET Windows Service which spawns a thread that basically just acts
I have a worker thread that is listening to a TCP socket for incoming
I have a .NET 2.0 server that seems to be running into scaling problems,
I have a fairly generic C# socket server that uses the asynchronous methods of
We have a nice class that establishes a socket connection and then hits it
I've followed the guide Setting Up Socket Streams and have effectively duplicated that code
I currently have a mobile app that uses a socket connection to communicate with
I have some socket connection code that makes use of boost::asio which reads from
I have a problem with a c++ socket. I'm using CAsyncSocket from MFC that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.